Skip to content

Conversation

@timflannagan
Copy link
Member

@timflannagan timflannagan commented Dec 11, 2025

Description

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.

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

NONE

Additional Notes

New repo: https://github.com/kgateway-dev/krtequals

Copilot AI review requested due to automatic review settings December 11, 2025 00:00
@gateway-bot gateway-bot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. release-note-none labels Dec 11, 2025
Copy link
Contributor

Copilot AI left a 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/krtequals directory including analyzer code, tests, and testdata
  • Configuration updates to reference the external module via .custom-gcl.yml
  • Addition of checkUnexported: true setting 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]>
@timflannagan
Copy link
Member Author

@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.

@timflannagan timflannagan added this pull request to the merge queue Dec 11, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 11, 2025
@timflannagan timflannagan added this pull request to the merge queue Dec 11, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 11, 2025
@yuval-k yuval-k added this pull request to the merge queue Dec 11, 2025
github-merge-queue bot pushed a commit that referenced this pull request Dec 11, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 11, 2025
@yuval-k yuval-k added this pull request to the merge queue Dec 11, 2025
github-merge-queue bot pushed a commit that referenced this pull request Dec 11, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 11, 2025
@timflannagan timflannagan added this pull request to the merge queue Dec 11, 2025
Merged via the queue into kgateway-dev:main with commit 2c9324b Dec 11, 2025
32 checks passed
@timflannagan timflannagan deleted the chore/update-krtequals branch December 11, 2025 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. release-note-none

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Publish the krtequals linter as a separate module

3 participants