Skip to content

lint: exclude revive var-naming instead of suppressing it per file - #27

Open
kmannislands wants to merge 1 commit into
giles-registry-proxy-framingfrom
lint-revive-var-naming
Open

kmannislands wants to merge 1 commit into
giles-registry-proxy-framingfrom
lint-revive-var-naming

Conversation

@kmannislands

Copy link
Copy Markdown

Stacked on #24.

Protobuf packages are named by the .proto, so revive's var-naming fires on every file declaring one. Fourteen files carried a //nolint:revive for it, and #24 had to add a fifteenth — which is what prompted this.

What upstream does: origin/master's revive exclude list is identical to ours plus a var-naming entry. Upstream then converted the leftover directives to //nolint:staticcheck, because a newer staticcheck absorbed stylecheck's ST1003, which flags the same thing. Our pinned golangci-lint 1.55 keeps stylecheck separate and doesn't enable it, so nothing needs to replace the directives here.

Removing them isn't optional once the exclusion lands: nolintlint is enabled, so an unused directive is itself a failure.

The set matches the one upstream converted — package clauses, _LOOP_CTL_GET_FREE, IsSolve_Subject — verified by running revive 1.3.2 (the version 1.55 bundles) with var-naming alone. dockerfile_test.go keeps its directive; that one is context-as-argument, a different rule.

Net effect on the fork delta: fifteen lines closer to upstream, not further.

🤖 Generated with Claude Code

@kmannislands
kmannislands added this pull request to stack #26 September 11, 2026 16:17
@github-actions

Copy link
Copy Markdown

⚠️ Are we earthbuild yet?

Warning: "earthly" occurrences have increased by 2 (0.92%)

📈 Overall Progress

Branch Total Count
main 217
This PR 219
Difference +2 (0.92%)

📁 Changes by file type:

File Type Change
Go files (.go) ❌ +2
Documentation (.md) ➖ No change
Earthfiles ➖ No change

Keep up the great work migrating from Earthly to Earthbuild! 🚀

💡 Tips for finding more occurrences

Run locally to see detailed breakdown:

./.github/scripts/count-earthly.sh

Note that the goal is not to reach 0.
There is anticipated to be at least some occurences of earthly in the source code due to backwards compatibility with config files and language constructs.

Protobuf packages are named by the .proto, so revive's var-naming rule
fires on every file that declares one, and fourteen files carried a
//nolint:revive to silence it. copy.go in #24 had to grow one too, which
is what prompted this.

Upstream already solved it in config -- origin/master's exclude list is
ours plus a var-naming entry -- and converted the remaining directives to
//nolint:staticcheck, which is a newer staticcheck absorbing stylecheck's
ST1003. Our pinned golangci-lint 1.55 keeps stylecheck separate and does
not enable it, so nothing replaces the directives here.

Removing them is not optional once the exclusion lands: nolintlint is
enabled, and an unused directive is itself a lint failure. The set is the
one upstream converted -- package clauses, _LOOP_CTL_GET_FREE, and
IsSolve_Subject -- verified by running revive 1.3.2, the version 1.55
bundles, with var-naming alone. dockerfile_test.go keeps its directive:
that one is context-as-argument, a different rule.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@kmannislands kmannislands self-assigned this Sep 14, 2026
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