diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 54fd29c..dcd75ea 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,7 +11,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 with: - go-version: 1.19 + go-version: 1.21 - uses: actions/cache@v3 with: @@ -20,11 +20,11 @@ jobs: restore-keys: | ${{ runner.os }}-go- - - name: Lint - run: | - go vet -stdmethods=false $(go list ./...) - go install mvdan.cc/gofumpt@v0.2.0 - test -z "$(gofumpt -l -extra .)" + - name: Golangci Lint + # https://golangci-lint.run/ + uses: golangci/golangci-lint-action@v3 + with: + version: latest - name: Unit Test run: go test -race -covermode=atomic -coverprofile=coverage.out ./... diff --git a/.golangci.yaml b/.golangci.yaml new file mode 100644 index 0000000..d967796 --- /dev/null +++ b/.golangci.yaml @@ -0,0 +1,34 @@ +# Options for analysis running. +run: + # include `vendor` `third_party` `testdata` `examples` `Godeps` `builtin` + skip-dirs-use-default: true +# output configuration options +output: + # Format: colored-line-number|line-number|json|tab|checkstyle|code-climate|junit-xml|github-actions + formats: colored-line-number +# All available settings of specific linters. +# Refer to https://golangci-lint.run/usage/linters +linters-settings: + gofumpt: + # Choose whether to use the extra rules. + # Default: false + extra-rules: true + govet: + # Disable analyzers by name. + # Run `go tool vet help` to see all analyzers. + disable: + - stdmethods +linters: + enable: + - gofumpt + - goimports + - gofmt + disable: + - errcheck + - typecheck + - staticcheck +issues: + exclude-use-default: true + exclude-files: + - ".*\\.mock\\.go$" + exclude-dirs: