Skip to content

Commit

Permalink
ci: add Lint check on commits (zeromicro#1086)
Browse files Browse the repository at this point in the history
* ci: add Lint check on commits

* ci: fix Lint script error

* test: fix go vet errors

* test: fix go vet errors, remove gofumpt to check go vet

* test: fix go vet errors, try gofumpt

* test: fix go vet errors, try gofumpt, round 1

* test: fix go vet errors, try gofumpt, round 2

* ci: fix Lint errors
  • Loading branch information
kevwan authored Sep 23, 2021
1 parent d87d203 commit 8403ed1
Show file tree
Hide file tree
Showing 12 changed files with 41 additions and 16 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ jobs:
run: |
go get -v -t -d ./...
- name: Lint
run: |
go vet -stdmethods=false $(go list ./...)
go install mvdan.cc/gofumpt@latest
test -z "$(gofumpt -s -l -extra .)"
- name: Test
run: go test -race -coverprofile=coverage.txt -covermode=atomic ./...

Expand Down
3 changes: 2 additions & 1 deletion core/discov/internal/statewatcher_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion core/discov/internal/updatelistener_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions core/fs/files.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux || darwin
// +build linux darwin

package fs
Expand Down
1 change: 1 addition & 0 deletions core/proc/shutdown.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux || darwin
// +build linux darwin

package proc
Expand Down
1 change: 1 addition & 0 deletions core/search/tree_debug.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build debug
// +build debug

package search
Expand Down
1 change: 1 addition & 0 deletions core/stat/alert.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package stat
Expand Down
1 change: 1 addition & 0 deletions core/stat/alert_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package stat
Expand Down
3 changes: 2 additions & 1 deletion core/stores/mongo/internal/collection_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion core/stores/mongo/iter_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion core/syncx/pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ func TestPoolGet(t *testing.T) {
ch := make(chan lang.PlaceholderType)

for i := 0; i < limit; i++ {
var fail AtomicBool
go func() {
v := stack.Get()
if v.(int) != 1 {
t.Fatal("unmatch value")
fail.Set(true)
}
ch <- lang.Placeholder
}()
Expand All @@ -30,6 +31,10 @@ func TestPoolGet(t *testing.T) {
case <-time.After(time.Second):
t.Fail()
}

if fail.True() {
t.Fatal("unmatch value")
}
}
}

Expand Down
27 changes: 16 additions & 11 deletions zrpc/internal/mock/deposit.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8403ed1

Please sign in to comment.