Skip to content

Commit e796b43

Browse files
committed
migrate to nevarro-space organization
Signed-off-by: Sumner Evans <[email protected]>
1 parent 8255513 commit e796b43

File tree

6 files changed

+28
-14
lines changed

6 files changed

+28
-14
lines changed

Diff for: .github/dependabot.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "gomod"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
8+
- package-ecosystem: "github-actions"
9+
directory: "/"
10+
schedule:
11+
interval: "weekly"

Diff for: .pre-commit-config.yaml

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.1.0
3+
rev: v4.4.0
44
hooks:
55
- id: trailing-whitespace
66
exclude_types: [markdown]
@@ -9,6 +9,12 @@ repos:
99
- id: check-added-large-files
1010

1111
- repo: https://github.com/tekwizely/pre-commit-golang
12-
rev: v1.0.0-beta.5
12+
rev: v1.0.0-rc.1
1313
hooks:
1414
- id: go-imports-repo
15+
args:
16+
- "-local"
17+
- "github.com/sumnerevans/matrix-chessbot"
18+
- "-w"
19+
- id: go-vet-repo-mod
20+
- id: go-staticcheck-repo-mod

Diff for: chessbot.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
mevent "maunium.net/go/mautrix/event"
1616
mid "maunium.net/go/mautrix/id"
1717

18-
"github.com/sumnerevans/matrix-chessbot/store"
18+
"github.com/nevarro-space/matrix-chessbot/store"
1919
)
2020

2121
type ChessBot struct {
@@ -89,7 +89,6 @@ func main() {
8989
c := make(chan os.Signal, 1)
9090
signal.Notify(c,
9191
os.Interrupt,
92-
os.Kill,
9392
syscall.SIGABRT,
9493
syscall.SIGHUP,
9594
syscall.SIGINT,

Diff for: go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/sumnerevans/matrix-chessbot
1+
module github.com/nevarro-space/matrix-chessbot
22

33
go 1.16
44

Diff for: helper.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func DoRetry(description string, fn func() (interface{}, error)) (interface{}, e
3434
log.Debugf(" %s failed. Retrying in %f seconds...", description, nextDuration.Seconds())
3535
if stop {
3636
log.Debugf(" %s failed. Retry limit reached. Will not retry.", description)
37-
err = errors.New("%s failed. Retry limit reached. Will not retry.")
37+
err = errors.New("%s failed. Retry limit reached. Will not retry")
3838
break
3939
}
4040
time.Sleep(nextDuration)

Diff for: message_handler.go

+6-8
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"errors"
55
"fmt"
66
"image/color"
7-
"io/ioutil"
7+
"io"
88
"os"
99
"os/exec"
1010
"regexp"
@@ -28,14 +28,14 @@ func sendHelp(roomId mid.RoomID) {
2828
* new -- start a new game of chess
2929
* help -- show this help
3030
31-
Version %s. Source code: https://github.com/sumnerevans/matrix-chessbot`
31+
Version %s. Source code: https://github.com/nevarro-space/matrix-chessbot`
3232
noticeHtml := `<b>COMMANDS:</b>
3333
<ul>
3434
<li><b>new</b> &mdash; start a new game of chess</li>
3535
<li><b>help</b> &mdash; show this help</li>
3636
</ul>
3737
38-
Version %s. <a href="https://github.com/sumnerevans/matrix-chessbot">Source code</a>.`
38+
Version %s. <a href="https://github.com/nevarro-space/matrix-chessbot">Source code</a>.`
3939

4040
SendMessage(roomId, &mevent.MessageEventContent{
4141
MsgType: mevent.MsgNotice,
@@ -82,7 +82,7 @@ func getCommandParts(body string) ([]string, error) {
8282
}
8383
}
8484
if !isCommand {
85-
return []string{}, errors.New("Not a command")
85+
return []string{}, errors.New("not a command")
8686
}
8787

8888
return commandParts, nil
@@ -115,12 +115,12 @@ func boardToPngBytes(board *chess.Board, squares ...chess.Square) ([]byte, error
115115
}
116116

117117
pngFile, err := os.Open(pngTempfile.Name())
118-
defer pngFile.Close()
119118
if err != nil {
120119
return []byte{}, err
121120
}
121+
defer pngFile.Close()
122122

123-
return ioutil.ReadAll(pngFile)
123+
return io.ReadAll(pngFile)
124124
}
125125

126126
var StateChessGame = mevent.Type{Type: "space.nevarro.chess.game", Class: mevent.StateEventType}
@@ -156,10 +156,8 @@ func handleCommand(source mautrix.EventSource, event *mevent.Event, commandParts
156156
saveGame(event.RoomID, game, boardImageEvent.EventID)
157157
}
158158

159-
break
160159
default:
161160
sendHelp(event.RoomID)
162-
break
163161
}
164162
}
165163

0 commit comments

Comments
 (0)