Skip to content

Add linting documentation and pre-commit hooks#177

Merged
tadasant merged 2 commits intomainfrom
tadasant/setup-cc-to-locally-lint
Jul 15, 2025
Merged

Add linting documentation and pre-commit hooks#177
tadasant merged 2 commits intomainfrom
tadasant/setup-cc-to-locally-lint

Conversation

@tadasant
Copy link
Member

@tadasant tadasant commented Jul 12, 2025

Summary

This PR improves the developer experience by adding clear linting documentation and optional pre-commit hooks to catch issues before CI. Helpful to avoid fighting Claude Code / Copilot on "please make sure linting passes CI".

Changes

  • Updated README.md with:

    • Go 1.23.x requirement (was "1.18 or later")
    • golangci-lint v1.61.0 in prerequisites
    • New Development section with linting instructions
  • Updated CLAUDE.md with:

    • Development Setup section
  • Added .githooks/pre-commit:

    • Runs golangci-lint and gofmt checks
    • References README for installation instructions
    • Can be bypassed with --no-verify when needed

Test Plan

  • Verified pre-commit hook blocks commits when golangci-lint is missing
  • Confirmed hook shows clear error message pointing to README
  • Tested that linting passes with Go 1.23.0 and golangci-lint v1.61.0
  • Verified gofmt correctly identifies formatting issues

Co-authored w/ Claude Code

- Update README.md with Go 1.23.x requirement and golangci-lint setup
- Add Development section with linting instructions
- Update CLAUDE.md with simplified development setup
- Add optional pre-commit hook for automatic linting checks
- Reference README from pre-commit hook to avoid duplication
@tadasant tadasant requested review from a team, chlowell and toby July 12, 2025 00:53
chlowell
chlowell previously approved these changes Jul 14, 2025
Co-authored-by: Charles Lowell <10964656+chlowell@users.noreply.github.com>
@tadasant
Copy link
Member Author

@chlowell sorry looks like that one liner change prevents me from pushing, mind approving again?

@tadasant tadasant merged commit 4e221e4 into main Jul 15, 2025
10 checks passed
@tadasant tadasant deleted the tadasant/setup-cc-to-locally-lint branch July 15, 2025 16:31
domdomegg pushed a commit that referenced this pull request Aug 7, 2025
## Summary

This PR improves the developer experience by adding clear linting
documentation and optional pre-commit hooks to catch issues before CI.
Helpful to avoid fighting Claude Code / Copilot on "please make sure
linting passes CI".

## Changes

- Updated `README.md` with:
  - Go 1.23.x requirement (was "1.18 or later")
  - golangci-lint v1.61.0 in prerequisites
  - New Development section with linting instructions
  
- Updated `CLAUDE.md` with:
  - Development Setup section
  
- Added `.githooks/pre-commit`:
  - Runs golangci-lint and gofmt checks
  - References README for installation instructions
  - Can be bypassed with `--no-verify` when needed

## Test Plan

- [x] Verified pre-commit hook blocks commits when golangci-lint is
missing
- [x] Confirmed hook shows clear error message pointing to README
- [x] Tested that linting passes with Go 1.23.0 and golangci-lint
v1.61.0
- [x] Verified gofmt correctly identifies formatting issues

Co-authored w/ Claude Code

---------

Co-authored-by: Charles Lowell <10964656+chlowell@users.noreply.github.com>
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