Skip to content

Commit

Permalink
Merge branch 'upgrade-golangci-lint' into upgrade-client-go-7.5
Browse files Browse the repository at this point in the history
Signed-off-by: Ping Yu <[email protected]>
  • Loading branch information
pingyu committed Dec 2, 2023
2 parents 16d1c27 + 420a0bf commit 71038fb
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 15 deletions.
18 changes: 9 additions & 9 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ linters-settings:
- name: unreachable-code

depguard:
list-type: blacklist
include-go-root: false
packages:
- log
- github.com/juju/errors
packages-with-error-message:
# specify an error message to output when a blacklisted package is used
- log: "logging is allowed only by pingcap/log"
- github.com/juju/errors: "error handling is allowed only by pingcap/errors"
rules:
main:
list-mode: lax # everything is allowed unless it is denied.
deny:
- pkg: "log"
desc: logging is allowed only by pingcap/log
- pkg: "github.com/juju/errors"
desc: error handling is allowed only by pingcap/errors

staticcheck:
checks: ["S1002","S1004","S1007","S1009","S1010","S1012","S1019","S1020","S1021","S1024","S1030","SA2*","SA3*","SA4009","SA5*","SA6000","SA6001","SA6005", "-SA2002"]
stylecheck:
Expand Down
2 changes: 1 addition & 1 deletion br/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ failpoint/disable: tools/bin/failpoint-ctl
find `pwd` -type d | grep -vE "(\.git|tools)" | xargs tools/bin/failpoint-ctl disable

tools/bin/golangci-lint:
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ./tools/bin v1.52.2
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ./tools/bin v1.55.2

tools/bin/failpoint-ctl: tools/check/go.mod
cd tools/check && $(GO) build -o ../bin/failpoint-ctl github.com/pingcap/failpoint/failpoint-ctl
Expand Down
2 changes: 1 addition & 1 deletion cdc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ tools/bin/goveralls: tools/check/go.mod
cd tools/check && $(GO) build -mod=mod -o ../bin/goveralls github.com/mattn/goveralls

tools/bin/golangci-lint: tools/check/go.mod
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b tools/bin v1.51.1
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b tools/bin v1.55.2

tools/bin/mockgen: tools/check/go.mod
cd tools/check && $(GO) build -mod=mod -o ../bin/mockgen github.com/golang/mock/mockgen
Expand Down
3 changes: 1 addition & 2 deletions cdc/cdc/model/kv.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,8 @@ func (e *RegionFeedEvent) GetValue() interface{} {
return e.Val
} else if e.Resolved != nil {
return e.Resolved
} else {
return nil
}
return nil
}

// ResolvedSpan guarantees all the KV value event
Expand Down
3 changes: 1 addition & 2 deletions cdc/pkg/fsutil/filelock.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ func (fl *FileLock) IsLocked() (bool, error) {
return true, nil
} else if err != nil {
return false, errors.Trace(err)
} else {
return false, nil
}
return false, nil
}

0 comments on commit 71038fb

Please sign in to comment.