From b604b2c5947e6c09e7a808299890b8f202577c8d Mon Sep 17 00:00:00 2001 From: Seth Hoenig Date: Tue, 31 Mar 2026 21:12:27 -0500 Subject: [PATCH] ci: update golangci-lint and remove copywrite --- .github/workflows/ci.yaml | 10 --- .github/workflows/scripts/copywrite.hcl | 13 ---- .github/workflows/scripts/golangci.yaml | 88 ++++++++++++------------- .golangci.yaml | 40 ----------- Justfile | 9 +-- go.mod | 2 +- 6 files changed, 46 insertions(+), 116 deletions(-) delete mode 100644 .github/workflows/scripts/copywrite.hcl delete mode 100644 .golangci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 27cecfe..fd0bde2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -8,16 +8,6 @@ on: branches: - 'main' jobs: - run-copywrite: - timeout-minutes: 5 - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v6 - - uses: hashicorp/setup-copywrite@v1.1.3 - - name: verify copyright - run: | - copywrite --config .github/workflows/scripts/copywrite.hcl \ - headers --spdx "BSD-3-Clause" --plan run-tests: timeout-minutes: 5 runs-on: ubuntu-24.04 diff --git a/.github/workflows/scripts/copywrite.hcl b/.github/workflows/scripts/copywrite.hcl deleted file mode 100644 index 2ee1ec8..0000000 --- a/.github/workflows/scripts/copywrite.hcl +++ /dev/null @@ -1,13 +0,0 @@ -schema_version = 1 - -project { - license = "BSD-3-Clause" - copyright_holder = "CattleCloud LLC" - copyright_year = 2024 - header_ignore = [ - ".golangci.yaml", - ".copywrite.hcl", - ".github/**", - ] -} - diff --git a/.github/workflows/scripts/golangci.yaml b/.github/workflows/scripts/golangci.yaml index dfa19b8..432cc83 100644 --- a/.github/workflows/scripts/golangci.yaml +++ b/.github/workflows/scripts/golangci.yaml @@ -1,46 +1,46 @@ -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 - - paralleltest - - perfsprint - - prealloc - - predeclared - - reassign - - revive - - rowserrcheck - - staticcheck - - sqlclosecheck - - tagalign - - tenv - - unused - - whitespace - -linters-settings: - paralleltest: - ignore-missing-subtests: true - exhaustive: - default-signifies-exhaustive: true + - asasalint + - asciicheck + - bidichk + - bodyclose + - copyloopvar + - dogsled + - dupword + - durationcheck + - errname + - errorlint + - exhaustive + - gochecknoinits + - gocritic + - makezero + - misspell + - musttag + - nilnil + - noctx + - paralleltest + - 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/.golangci.yaml b/.golangci.yaml deleted file mode 100644 index 56b632c..0000000 --- a/.golangci.yaml +++ /dev/null @@ -1,40 +0,0 @@ -run: - timeout: 5m -linters: - enable: - - asasalint - - asciicheck - - bidichk - - bodyclose - - dogsled - - dupword - - durationcheck - - errcheck - - errname - - errorlint - - exhaustive - - exportloopref - - gochecknoinits - - gocritic - - gofmt - - gosimple - - govet - - ineffassign - - makezero - - misspell - - musttag - - nilnil - - noctx - - perfsprint - - prealloc - - predeclared - - reassign - - revive - - rowserrcheck - - staticcheck - - sqlclosecheck - - tagalign - - tenv - - unused - - whitespace - diff --git a/Justfile b/Justfile index f13bf1e..1e94a3c 100644 --- a/Justfile +++ b/Justfile @@ -18,13 +18,6 @@ tidy: test: go test -v -race -count=1 ./... -# ensure copywrite headers present on source files -[group('lint')] -copywrite: - copywrite \ - --config {{scripts}}/copywrite.hcl headers \ - --spdx "BSD-3-Clause" - # apply go vet command on source tree [group('lint')] vet: @@ -43,5 +36,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.11.4 diff --git a/go.mod b/go.mod index c44eca2..df0defc 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ module cattlecloud.net/go/ulog -go 1.23 +go 1.26