Skip to content

fix: resolve all golangci-lint v2 violations - #51

Merged
HerbHall merged 2 commits into
mainfrom
fix/lint-cleanup
Mar 2, 2026
Merged

fix: resolve all golangci-lint v2 violations#51
HerbHall merged 2 commits into
mainfrom
fix/lint-cleanup

Conversation

@HerbHall

@HerbHall HerbHall commented Mar 2, 2026

Copy link
Copy Markdown
Owner

Summary

Fix 24 lint issues surfaced by the golangci-lint v2 migration in PR #50, plus 6 pre-existing markdownlint violations:

  • exhaustive (5): Add missing enum switch cases for PhaseDealerTurn, Empty, Revealed, Playing, NumCategories
  • gofmt (60 files): Normalize line endings across all Go source files
  • gosec (7): Annotate safe integer conversions (G115) and bounds-guaranteed slice accesses (G602) with nolint
  • prealloc (4): Preallocate slices with known capacity in minesweeper, twofortyeight, and typingtest view functions
  • staticcheck (5): Use fmt.Fprintf instead of WriteString(fmt.Sprintf(...)), apply De Morgan's law, convert if/else chain to tagged switch
  • markdownlint (6): Wrap long lines in CLAUDE.md (MD013), fix table separator style in README.md (MD060)

golangci-lint run ./... reports 0 issues. markdownlint-cli2 reports 0 errors.

Test plan

  • go build ./... passes
  • go test ./... passes (all 18 test suites)
  • golangci-lint run ./... reports 0 issues
  • markdownlint-cli2 "**/*.md" reports 0 errors
  • Pre-push hook passes all checks

Co-Authored-By: Claude noreply@anthropic.com

HerbHall and others added 2 commits March 2, 2026 11:56
Fix 24 lint issues surfaced by the v2 migration:
- exhaustive (5): add missing enum switch cases for PhaseDealerTurn,
  Empty, Revealed, Playing, NumCategories
- gofmt (60 files): normalize line endings across all Go source files
- gosec (7): annotate safe integer conversions (G115) and
  bounds-guaranteed slice accesses (G602) with nolint
- prealloc (4): preallocate slices with known capacity in minesweeper,
  twofortyeight, and typingtest view functions
- staticcheck (5): use fmt.Fprintf instead of WriteString+Sprintf,
  apply De Morgan's law, convert if/else chain to tagged switch

All 24 issues resolved. golangci-lint run ./... reports 0 issues.

Co-Authored-By: Claude <noreply@anthropic.com>
- CLAUDE.md: wrap long lines to fix MD013 (line-length)
- README.md: add spaces to table separator for MD060 (table-column-style)

Co-Authored-By: Claude <noreply@anthropic.com>
@HerbHall
HerbHall merged commit d49b1be into main Mar 2, 2026
2 checks passed
@HerbHall
HerbHall deleted the fix/lint-cleanup branch March 2, 2026 17:00
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