Skip to content

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

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

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.

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
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

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

  • Fix all pre-merge checks with AI
✨ 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

Warning

Some tools did not complete. Review the errors below.

🔧 golangci-lint (2.13.2)

Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions
The command is terminated due to an error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions


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

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