chore: add golangci-lint config and fix lint issues #88

Merged
wbtiger merged 1 commits from muel/gitlink-cli:chore/add-lint-and-fix-issues into master 2026-05-31 00:38:34 +08:00
Member

Summary

  • Add .golangci.yml with 8 essential linters (errcheck, govet, ineffassign, staticcheck, unused, errorlint, gosec, misspell)
  • Fix real bugs found by lint:
    • errors.As instead of type assertion in api error handling
    • %w instead of %v for error wrapping
    • Remove unnecessary nil map check
    • Remove unused sortedStrings function
    • Simlify redundant if-return
    • Remove unnecessary int() conversion
    • Remove unused function parameter
    • Simplify clampInt signature (remove always-zero minValue param)
  • Add make lint target, include in make check pipeline (fmt → vet → lint → test)
  • Update pre-commit hook to include lint step

Test plan

  • make check passes (fmt + vet + lint + test)
  • golangci-lint run ./... reports 0 issues
  • All 143 unit tests pass

? Generated with Claude Code

## Summary - Add `.golangci.yml` with 8 essential linters (errcheck, govet, ineffassign, staticcheck, unused, errorlint, gosec, misspell) - Fix real bugs found by lint: - `errors.As` instead of type assertion in api error handling - `%w` instead of `%v` for error wrapping - Remove unnecessary nil map check - Remove unused `sortedStrings` function - Simlify redundant if-return - Remove unnecessary `int()` conversion - Remove unused function parameter - Simplify `clampInt` signature (remove always-zero minValue param) - Add `make lint` target, include in `make check` pipeline (fmt → vet → lint → test) - Update pre-commit hook to include lint step ## Test plan - [x] `make check` passes (fmt + vet + lint + test) - [x] `golangci-lint run ./...` reports 0 issues - [x] All 143 unit tests pass ? Generated with [Claude Code](https://claude.com/claude-code)
wbtiger added 1 commit 2026-05-31 00:37:32 +08:00
f7263cc466 chore: add golangci-lint config and fix lint issues
- Add .golangci.yml with 8 essential linters (errcheck, govet,
  ineffassign, staticcheck, unused, errorlint, gosec, misspell)
- Fix real bugs: errors.As, %w wrapping, nil map check, dead code,
  unnecessary conversion, unused parameters
- Add `make lint` target, include it in `make check` pipeline
- Update pre-commit hook to run lint step

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
wbtiger merged commit c969631495 into master 2026-05-31 00:38:34 +08:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Gitlink/gitlink-cli#88
No description provided.