Skip to content

Comments

Fix code formatting and add gofmt enforcement#3

Open
vladkampov wants to merge 4 commits intomainfrom
fix/gofmt-formatting
Open

Fix code formatting and add gofmt enforcement#3
vladkampov wants to merge 4 commits intomainfrom
fix/gofmt-formatting

Conversation

@vladkampov
Copy link
Owner

Summary

  • Formats all Go files with gofmt to improve Go Report Card score from C to A
  • Adds automated formatting checks to prevent future formatting issues
  • Makes pre-commit hook contributor-friendly by skipping linter if not installed

Changes

  • ✅ Formatted all 11 Go files with gofmt
  • ✅ Added make fmt and make fmt-check targets to Makefile
  • ✅ Created pre-commit hook that checks formatting (skips linting if golangci-lint not installed)
  • ✅ Added gofmt check to CI workflow
  • ✅ Created comprehensive .golangci.yml configuration

Test plan

  • Run make fmt-check - should pass
  • Try committing unformatted code - should fail with clear error
  • CI workflow will check formatting on this PR
  • Pre-commit hook works without golangci-lint installed

This addresses the Go Report Card score of C due to 0% gofmt compliance. All code is now properly formatted and future commits will be automatically checked for formatting issues.

🤖 Generated with Claude Code

- Format all Go files with gofmt to improve Go Report Card score
- Add `make fmt` and `make fmt-check` targets to Makefile
- Add pre-commit hook to check formatting before commits
- Add gofmt check to CI workflow to enforce formatting in PRs
- Create comprehensive golangci-lint configuration with gofmt enabled
- Make pre-commit hook skip linting if golangci-lint not installed

This addresses the Go Report Card score of C due to 0% gofmt compliance.
All code is now properly formatted and future commits will be automatically
checked for formatting issues.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Jun 27, 2025

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

vladkampov and others added 3 commits June 28, 2025 00:26
The 'check-shadowing' option is no longer valid in newer versions of
golangci-lint. Updated to use the correct 'enable: [shadow]' syntax.
- Add 'make check-all' to run same checks as CI locally
- Add 'make fmt-fix' to auto-fix what golangci-lint can handle
- Add development setup script for contributors
- Enhanced golangci-lint config with auto-fixable linters
- Updated fmt target to include goimports

Contributors can now:
- Run 'make check-all' to catch issues before pushing
- Run 'make fmt-fix' to auto-fix formatting and some lint issues
- Use './scripts/setup-dev.sh' to set up development environment

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Use correct 'sections' syntax instead of deprecated 'local-prefixes'
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