diff --git a/.github/workflows/ci.yml.disabled b/.github/workflows/ci.yml similarity index 86% rename from .github/workflows/ci.yml.disabled rename to .github/workflows/ci.yml index 3f2fff1..dabf80d 100644 --- a/.github/workflows/ci.yml.disabled +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go-version: ['1.22', '1.23', '1.24'] + go-version: ['1.24'] steps: - uses: actions/checkout@v4 @@ -41,6 +41,6 @@ jobs: go-version: '1.24' - name: golangci-lint - uses: golangci/golangci-lint-action@v4 + uses: golangci/golangci-lint-action@v9 with: - version: latest + version: v2.12.2 diff --git a/.github/workflows/release.yml.disabled b/.github/workflows/release.yml similarity index 97% rename from .github/workflows/release.yml.disabled rename to .github/workflows/release.yml index 55ea3cc..94d135c 100644 --- a/.github/workflows/release.yml.disabled +++ b/.github/workflows/release.yml @@ -29,9 +29,9 @@ jobs: run: gotestsum --format=testdox -- -race ./... - name: golangci-lint - uses: golangci/golangci-lint-action@v4 + uses: golangci/golangci-lint-action@v9 with: - version: latest + version: v2.12.2 release: needs: validate diff --git a/.golangci.yml b/.golangci.yml index 40d7b6e..d944d6d 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,20 +1,48 @@ -run: - timeout: 5m +version: "2" linters: + # Default v2 linter set: errcheck, govet, ineffassign, staticcheck, unused. + # gofmt and goimports moved to formatters in v2 (configured below). + settings: + errcheck: + exclude-functions: + - (io.Closer).Close + - (*os.File).Close + - os.Chmod + - os.MkdirAll + - (github.com/sageox/agentx.Registry).Register + - (*github.com/sageox/agentx.DefaultRegistryImpl).Register + - (github.com/sageox/agentx.Environment).Remove + - fmt.Sscanf + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$ + rules: + # Test files routinely use Close/Chmod/Register without error checks + # for setup and cleanup. Those errors aren't actionable in tests. + - path: _test\.go + linters: + - errcheck + # QF1011 flags `var _ Iface = impl` interface-conformance assertions, + # but the explicit type is the whole point of the pattern. + - text: "QF1011" + linters: + - staticcheck + +formatters: enable: - - errcheck - - gosimple - - govet - - ineffassign - - staticcheck - - unused - gofmt - goimports - -linters-settings: - goimports: - local-prefixes: github.com/sageox/agentx - -issues: - exclude-use-default: false + settings: + goimports: + local-prefixes: + - github.com/sageox/agentx + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$