-
Notifications
You must be signed in to change notification settings - Fork 616
Replace hack/krtequals with standalone krtequals module #13091
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace hack/krtequals with standalone krtequals module #13091
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR replaces the in-tree hack/krtequals linter implementation with a standalone module (github.com/kgateway-dev/krtequals). The change consolidates the custom linter into an external, independently maintained module with enhanced test coverage and additional configuration options like checkUnexported.
Key Changes:
- Complete removal of the local
hack/krtequalsdirectory including analyzer code, tests, and testdata - Configuration updates to reference the external module via
.custom-gcl.yml - Addition of
checkUnexported: truesetting in.golangci.yaml
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| .custom-gcl.yml | Updates module reference from local ./hack/krtequals to external github.com/kgateway-dev/krtequals with version pinning |
| .golangci.yaml | Adds checkUnexported: true configuration for the krtequals linter |
| Makefile | Removes hack/krtequals from the nested module tidy targets |
| hack/krtequals/analyzer.go | Deletes the entire in-tree analyzer implementation (295 lines) |
| hack/krtequals/plugin.go | Deletes the golangci-lint plugin wrapper |
| hack/krtequals/analyzer_test.go | Deletes analyzer tests |
| hack/krtequals/go.mod | Removes module definition for the local linter |
| hack/krtequals/go.sum | Removes dependency checksums |
| hack/krtequals/testdata/src/markers/markers.go | Deletes test data for marker functionality |
| hack/krtequals/testdata/src/deepequalon/deepequal.go | Deletes test data for DeepEqual check |
| hack/krtequals/testdata/src/deepequaloff/deepequal.go | Deletes test data for DeepEqual disabled mode |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Replace the in-tree hack/krtequals linter implementation with the standalone krtequals module (github.com/kgateway-dev/krtequals). The standalone module provides: - Improved test coverage for edge cases (chained expressions, delegated Equals calls, method arguments) - New checkUnexported config option to lint unexported struct fields - golangci-lint module plugin integration - Cleaner separation of concerns The original implementation has been ported and enhanced in the standalone repository with more robust testing and additional configuration options. Note: I disabled the checkUnexported config option for now. There's linting violations that will need to be burned down as a follow-up. Signed-off-by: timflannagan <[email protected]>
8dca98f to
44c5251
Compare
|
@yuval-k Had to flip the config option that checks for unexported fields in the latest force push to get CI back online. My backlog is a bit deep right now, so I'll likely create a follow-up issue to burn down these failures and enable that config option. |
Signed-off-by: timflannagan <[email protected]>
Signed-off-by: timflannagan <[email protected]>
Description
Replace the in-tree hack/krtequals linter implementation with the standalone krtequals module (github.com/kgateway-dev/krtequals).
The standalone module provides:
The original implementation has been ported and enhanced in the standalone repository with more robust testing and additional configuration options.
Note: I disabled the checkUnexported config option for now. There's linting violations that will need to be burned down as a follow-up.
See https://github.com/kgateway-dev/kgateway/actions/runs/20117197292/job/57729346589?pr=13091 for evidence on the current linting violations when the checkUnexported field has been enabled.
Fixes #13090.
Change Type
/kind cleanup
Changelog
Additional Notes
New repo: https://github.com/kgateway-dev/krtequals