Skip to content

chore: DevKit compliance -- golangci-lint v2, LICENSE, pre-push hook - #50

Merged
HerbHall merged 2 commits into
mainfrom
chore/devkit-compliance
Mar 2, 2026
Merged

chore: DevKit compliance -- golangci-lint v2, LICENSE, pre-push hook#50
HerbHall merged 2 commits into
mainfrom
chore/devkit-compliance

Conversation

@HerbHall

@HerbHall HerbHall commented Mar 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • Migrate .golangci.yml from v1 to v2 format (adds version: "2", restructures linters-settings to linters.settings, moves issues.exclude-rules to linters.exclusions.rules, moves gofmt/goimports to formatters section, removes gosimple which is merged into staticcheck in v2)
  • Add missing linters from DevKit standard: misspell, bodyclose, noctx, durationcheck, exhaustive, nilerr
  • Add MIT LICENSE
  • Add pre-push hook (scripts/pre-push committed copy + .git/hooks/pre-push local copy) with go build, go test, golangci-lint, and markdownlint checks

Known Lint Issues (pre-existing, follow-up PR)

The new linters surface 24 pre-existing issues in project code:

  • 5 exhaustive (missing enum cases in switches)
  • 3 gofmt (formatting in fifteenpuzzle)
  • 7 gosec (G602 slice bounds, G115 integer overflow)
  • 4 prealloc (slice preallocation)
  • 5 staticcheck (QF suggestions: fmt.Fprintf, De Morgan's law, tagged switch)

These are intentionally NOT fixed in this PR to keep it scoped to infrastructure only.

Test plan

  • go build ./... passes
  • go test ./... passes
  • golangci-lint run ./... loads v2 config successfully (exits with pre-existing issues only)
  • CI workflow passes build and test steps

🤖 Generated with Claude Code

HerbHall and others added 2 commits March 2, 2026 11:14
- Migrate .golangci.yml from v1 to v2 format
- Add missing linters from DevKit standard (misspell, bodyclose, noctx, etc.)
- Move gofmt/goimports to formatters section (v2 requirement)
- Remove gosimple (merged into staticcheck in v2)
- Add MIT LICENSE
- Add pre-push hook with Go build, test, lint, and markdownlint checks

Note: 24 pre-existing lint issues from new linters (exhaustive, gosec G602/G115,
prealloc, staticcheck QF) to be addressed in a follow-up PR.

Co-Authored-By: Claude <noreply@anthropic.com>
Action v6 rejects golangci-lint v2 config fields (version, formatters,
linters.settings). Action v7 is required for v2 compatibility.
Also removes install-mode: goinstall which doesn't work with v2.

Co-Authored-By: Claude <noreply@anthropic.com>
@HerbHall
HerbHall merged commit 2c6fb8c into main Mar 2, 2026
1 of 2 checks passed
@HerbHall
HerbHall deleted the chore/devkit-compliance branch March 2, 2026 16:43
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.

1 participant