Skip to content

Conversation

@kacpersaw
Copy link
Contributor

Summary

Add a linter job to CI, following the pattern used in coder/coder.

Changes

CI Workflow (.github/workflows/ci.yaml)

  • Add new lint job that runs golangci-lint using the official golangci/golangci-lint-action@v7
  • Uses golangci-lint v2.1.6 (latest stable v2 release)
  • Updates Go version to ~1.24 to match go.mod

Linter Configuration (.golangci.yaml)

New config file with:

  • Linters enabled: govet, errcheck, staticcheck, unused, ineffassign, misspell, revive
  • Formatters enabled: goimports
  • Sensible defaults for govet (enable-all, disable fieldalignment/shadow)
  • US locale for misspell

Code Fixes

Fixed lint issues found by the new linter:

  • logger.go: Added package comment, check error return value for initNamespace(), wrap Close() to handle error
  • logger_test.go: Wrap Close() to handle error, rename unused parameters to _
  • main.go: Wrap Close() to handle error, rename unused args parameter to _

- Add lint job to CI workflow using golangci-lint-action v7 with golangci-lint v2.1.6
- Create .golangci.yaml config with standard linters (govet, errcheck, staticcheck, unused, ineffassign, misspell, revive) and goimports formatter
- Fix lint issues:
  - Add package comment to logger.go
  - Check error return values for Close() calls
  - Rename unused function parameters to _
- Update Go version to 1.24 to match go.mod
- Move linters-settings to linters.settings (v2 schema change)
- Add comment to exported Close method
@kacpersaw kacpersaw merged commit db7bcb7 into main Dec 10, 2025
2 checks passed
@kacpersaw kacpersaw deleted the add-linter-job branch December 10, 2025 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants