diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index 6fb10a2..de8ca6c 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -6,14 +6,14 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v3 with: go-version: 1.21 - - uses: actions/cache@v2 + - uses: actions/cache@v3 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} diff --git a/.github/workflows/push-check.yml b/.github/workflows/push-check.yml index 2a5babd..d0d0755 100644 --- a/.github/workflows/push-check.yml +++ b/.github/workflows/push-check.yml @@ -13,10 +13,10 @@ jobs: - 8761:8761 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: go-version: 1.21 @@ -35,11 +35,6 @@ jobs: - name: typos-action uses: crate-ci/typos@v1.2.1 - - name: Lint - run: | - go vet -stdmethods=false $(go list ./...) - go install mvdan.cc/gofumpt@v0.2.0 - test -z "$(gofumpt -l -extra .)" - name: Unit Test run: go test -v -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: