Skip to content

Commit

Permalink
remove some linters to make ci faster (#2116)
Browse files Browse the repository at this point in the history
* remove gocritic for being too slow and remove zerologlint for not using zerolog

* refactor golangci-lint run command

* fix depguard config
  • Loading branch information
ykadowak authored Jul 10, 2023
1 parent 1e7f94c commit 9079592
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
1 change: 0 additions & 1 deletion .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ jobs:
go build -mod=readonly ./...
- name: Run golangci-lint
run: |
# golangci-lint run --config .golangci.yml --issues-exit-code 0
golangci-lint run --config .golangci.yml \
| reviewdog -f=golangci-lint -name=golangci -reporter=${REPORTER} -level=${LEVEL}
env:
Expand Down
26 changes: 15 additions & 11 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ linters:
- gochecknoglobals
- gochecknoinits
- goconst
- gocritic
- godot
- godox
- gofumpt
Expand Down Expand Up @@ -91,14 +90,14 @@ linters:
- unparam
- unused #(megacheck)
- usestdlibvars
- zerologlint
# Disabled by your configuration linters
# - cyclop
# - errcheck
# - forbidigo
# - funlen
# - gci
# - gocognit
# - gocritic
# - gocyclo
# - goerr113
# - gofmt
Expand All @@ -123,6 +122,7 @@ linters:
# - whitespace
# - wrapcheck
# - wslissues:
# - zerologlint
exclude-use-default: false
exclude-rules:
- path: _test\.go
Expand Down Expand Up @@ -163,15 +163,19 @@ linters-settings:
json: snake
yaml: snake
depguard:
list-type: blacklist
include-go-root: true
packages-with-error-message:
- errors: "errors is allowed only by internal/errors"
- k8s.io/apimachinery/pkg/api/errors: "errors is allowed only by internal/errors"
- github.com/cockroachdb/errors: "errors is allowed only by internal/errors"
- github.com/pkg/errors: "errors is allowed only by internal/errors"
- github.com/go-errors/errors: "errors is allowed only by internal/errors"
- golang.org/x/sync/errgroup: "errgroup is allowed only by internal/errgroup"
rules:
main:
deny:
- pkg: "errors"
desc: "errors is allowed only by internal/errors"
- pkg: "k8s.io/apimachinery/pkg/api/errors"
desc: "errors is allowed only by internal/errors"
- pkg: "github.com/cockroachdb/errors"
desc: "errors is allowed only by internal/errors"
- pkg: "github.com/pkg/errors"
desc: "errors is allowed only by internal/errors"
- pkg: github.com/go-errors/errors
desc: "errors is allowed only by internal/errors"
govet:
check-shadowing: true
enable-all: true

0 comments on commit 9079592

Please sign in to comment.