diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6bad9a1..ef92fba 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -34,5 +34,5 @@ jobs: just sysinfo - name: Run Go Test run: | - just init tidy lint test + just init tidy lint tests diff --git a/.github/workflows/scripts/golangci.yaml b/.github/workflows/scripts/golangci.yaml index 5be68bc..1f22f58 100644 --- a/.github/workflows/scripts/golangci.yaml +++ b/.github/workflows/scripts/golangci.yaml @@ -1,43 +1,45 @@ -run: - timeout: 5m +version: "2" linters: enable: - - asasalint - - asciicheck - - bidichk - - bodyclose - - copyloopvar - - dogsled - - dupword - - durationcheck - - errcheck - - errname - - errorlint - - exhaustive - - gochecknoinits - - gocritic - - gofmt - - gosimple - - govet - - ineffassign - - makezero - - misspell - - musttag - - nilnil - - noctx - - perfsprint - - prealloc - - predeclared - - reassign - - revive - - rowserrcheck - - staticcheck - - sqlclosecheck - - tagalign - - tenv - - unused - - whitespace - -linters-settings: - exhaustive: - default-signifies-exhaustive: true + - asasalint + - asciicheck + - bidichk + - bodyclose + - copyloopvar + - dogsled + - dupword + - durationcheck + - errname + - errorlint + - exhaustive + - gochecknoinits + - gocritic + - makezero + - misspell + - musttag + - nilnil + - noctx + - perfsprint + - prealloc + - predeclared + - reassign + - revive + - rowserrcheck + - sqlclosecheck + - tagalign + - usetesting + - whitespace + settings: + exhaustive: + default-signifies-exhaustive: true + paralleltest: + ignore-missing-subtests: true + exclusions: + generated: lax + presets: + - comments +formatters: + enable: + - gofmt + exclusions: + generated: lax diff --git a/Justfile b/Justfile index f13bf1e..00d55ed 100644 --- a/Justfile +++ b/Justfile @@ -13,10 +13,16 @@ default: tidy: go mod tidy -# run tests across source tree +# run specific unit test [group('build')] -test: - go test -v -race -count=1 ./... +[no-cd] +test unit: + go test -v -count=1 -race -run {{unit}} 2>/dev/null + +# run all tests across source tree +[group('build')] +tests: + go test -count=1 -race ./... 2>/dev/null # ensure copywrite headers present on source files [group('lint')] @@ -43,5 +49,5 @@ lint: vet # locally install build dependencies [group('build')] init: - go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.62.2 + go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.8.0