lint: exclude revive var-naming instead of suppressing it per file - #27
Open
kmannislands wants to merge 1 commit into
Open
kmannislands wants to merge 1 commit into
kmannislands wants to merge 1 commit into
Conversation
kmannislands
added this pull request to stack #26
September 11, 2026 16:17
|
| 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.shNote 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
force-pushed
the
lint-revive-var-naming
branch
from
September 11, 2026 17:23
9ca964f to
bbdbcd0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #24.
Protobuf packages are named by the
.proto, so revive'svar-namingfires on every file declaring one. Fourteen files carried a//nolint:revivefor 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 avar-namingentry. 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 keepsstylecheckseparate and doesn't enable it, so nothing needs to replace the directives here.Removing them isn't optional once the exclusion lands:
nolintlintis 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) withvar-namingalone.dockerfile_test.gokeeps its directive; that one iscontext-as-argument, a different rule.Net effect on the fork delta: fifteen lines closer to upstream, not further.
🤖 Generated with Claude Code