Skip to content

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

Closed
kmannislands wants to merge 2 commits into
giles-registry-proxy-framingfrom
lint-revive-var-naming
Closed

kmannislands wants to merge 2 commits into
giles-registry-proxy-framingfrom
lint-revive-var-naming

Conversation

@kmannislands

@kmannislands kmannislands commented Sep 11, 2026 •

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

Summary by CodeRabbit

  • Chores
    • Updated linting rules and removed outdated lint suppressions across the codebase. No user-facing behavior changed.

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

@kmannislands kmannislands self-assigned this Sep 14, 2026
@coderabbitai

coderabbitai Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 19 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 846cf4f7-270f-448d-a0f9-bcf0cc81dcf4
📥 Commits

Reviewing files that changed from the base of the PR and between 4009ee7 and eb610b9.

📒 Files selected for processing (18)
  • .golangci.yml
  • api/services/control/generate.go
  • api/services/registry/copy.go
  • api/services/registry/generate.go
  • api/services/registry/proxy_test.go
  • api/services/registry/server.go
  • api/types/generate.go
  • executor/resources/types/systypes.go
  • executor/resources/types/types.go
  • frontend/gateway/pb/caps.go
  • frontend/gateway/pb/exit.go
  • frontend/gateway/pb/generate.go
  • solver/errdefs/solve.go
  • sourcepolicy/pb/generate.go
  • sourcepolicy/pb/json.go
  • sourcepolicy/pb/json_test.go
  • util/apicaps/pb/generate.go
  • util/entitlements/security/security_linux.go

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: c9eceb97-271f-40bb-8b13-eb71209a4d25

📥 Commits

Reviewing files that changed from the base of the PR and between eb19b68 and 4009ee7.

📒 Files selected for processing (18)
  • .golangci.yml
  • api/services/control/generate.go
  • api/services/registry/copy.go
  • api/services/registry/generate.go
  • api/services/registry/proxy_test.go
  • api/services/registry/server.go
  • api/types/generate.go
  • executor/resources/types/systypes.go
  • executor/resources/types/types.go
  • frontend/gateway/pb/caps.go
  • frontend/gateway/pb/exit.go
  • frontend/gateway/pb/generate.go
  • solver/errdefs/solve.go
  • sourcepolicy/pb/generate.go
  • sourcepolicy/pb/json.go
  • sourcepolicy/pb/json_test.go
  • util/apicaps/pb/generate.go
  • util/entitlements/security/security_linux.go
💤 Files with no reviewable changes (3)
  • executor/resources/types/systypes.go
  • executor/resources/types/types.go
  • solver/errdefs/solve.go

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The lint configuration adds an exclusion rule for var-naming diagnostics. The changes also remove inline revive suppressions from package declarations and selected declarations across Go files.

Changes

Revive lint updates

Layer / File(s) Summary
Lint rule and inline suppression updates
.golangci.yml, api/services/control/generate.go, api/services/registry/*, api/types/generate.go, executor/resources/types/*.go, frontend/gateway/pb/*.go, solver/errdefs/solve.go, sourcepolicy/pb/*.go, util/apicaps/pb/generate.go, util/entitlements/security/security_linux.go
The lint configuration adds an exclusion for var-naming diagnostics. The Go files remove inline lint suppressions from package declarations and selected declarations.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 4009e

This change only adjusts lint configuration and source suppressions. It introduces no runtime risk and is ready to merge after normal checks.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 14 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: excluding revive's var-naming rule globally and removing redundant per-file suppressions.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 14 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@janishorsts

Copy link
Copy Markdown

@kmannislands, we should use the upstream .golangci-lint as is to avoid code-style drift and keep code parity as close as possible.

kmannislands and others added 2 commits October 6, 2026 19:35
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>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kmannislands
kmannislands force-pushed the lint-revive-var-naming branch from 4009ee7 to eb610b9 Compare October 7, 2026 02:37
@kmannislands

Copy link
Copy Markdown
Author

@janishorsts fair enough. This is slightly different and we'll get the nolint:revive fixes that you commented on before in the base PR when merging the upstream all at once then

Closing

An error occurred while trying to automatically change base from giles-registry-proxy-framing to main October 7, 2026 15:23
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.

2 participants