Add golangci-lint configuration, CI integration, and Justfile - #2
Conversation
Co-authored-by: dhaavi <18184155+dhaavi@users.noreply.github.com>
Co-authored-by: dhaavi <18184155+dhaavi@users.noreply.github.com>
Co-authored-by: dhaavi <18184155+dhaavi@users.noreply.github.com>
|
@copilot Add these linters:
Remove:
Also, all your code edits are non-issues, please revert them. |
Co-authored-by: dhaavi <18184155+dhaavi@users.noreply.github.com>
Done! Changes in commit 6fe2a63: ✅ Reverted all code edits to Added minimal nolint comments for Production code now has zero linter issues. |
|
@copilot |
Co-authored-by: dhaavi <18184155+dhaavi@users.noreply.github.com>
I attempted to configure I've disabled godox:
keywords:
- FIXMEAlternatively, if you'd like to use a grep-based approach in CI to specifically check for FIXME comments, I can add that to the workflow. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot the linter action is failing because it uses go 1.24. Please fix this. |
Co-authored-by: dhaavi <18184155+dhaavi@users.noreply.github.com>
|
@copilot Add a Justfile to the repo root, where the default action to is to list the actions and the "lint" action runs the linter. The "install-tools" action should install golang-ci-lint in the correct version. |
Co-authored-by: dhaavi <18184155+dhaavi@users.noreply.github.com>
Done in commit f378cde. The Justfile provides:
Also included additional useful commands: |
Add golangci-lint configuration, CI integration, and Justfile
Adds golangci-lint with curated linters focused on security and correctness for this cryptographic library, plus GitHub Actions CI integration and a Justfile for local development workflow.
Changes Made:
secret.go,mac.go,hash_test.go, andchallenge_test.gohave been reverted to their original statecopyloopvarlinter (fixed by Go 1.22)Configuration
Total linters enabled: 40 linters focusing on:
Disabled linters:
godox- Cannot be configured to only flag FIXME (keywords setting not working in golangci-lint v2.6.2)exhaustruct- Too strict, would require exhaustive struct field initializationwrapcheck- Too strict, would require wrapping all external errorscopyloopvar- Removed (fixed by Go 1.22)testpackage- Too restrictiveJustfile Commands
The Justfile provides the following commands for local development:
just(default): List all available commandsjust install-tools: Install golangci-lint in the correct version (latest)just lint: Run golangci-lint with proper timeoutjust test: Run all testsjust test-coverage: Run tests with coverage reportjust build: Build the projectjust fmt: Format codejust tidy: Tidy dependenciesjust clean: Clean build artifactsjust check: Run format, lint, and testTest Exclusions
Test files are exempted from strict checks (complexity, duplication, paralleltest, etc.) to allow flexible test patterns.
CI Workflow
Production Code Status
✅ Zero linter issues in production code (non-test files)
✅ All tests passing
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.