Repository navigation
fix(lint): run buildifier's linter in format-check; drop the empty aspect - #1256
Merged
Merged
Conversation
bpalermo
marked this pull request as ready for review
October 5, 2026 14:10
bpalermo
force-pushed
the
fix/1245-buildifier-lint
branch
from
October 5, 2026 14:40
68a8136 to
cdf7b8f
Compare
…pect rules_lint's buildifier aspect only visits bzl_library targets and filegroups tagged "starlark"; this repository has neither, so under --config=lint it created zero AspectRulesLintBuildifier actions (aquery: Buf 12, ShellCheck 26, Buildifier 0) and a lint-dirty .bzl (unused load, no module docstring) passed `bazel build --config=lint --@aspect_rules_lint//lint:fail_on_violation //...`. Lint rides the Starlark formatter instead, via format_multirun's starlark_check_args / starlark_fix_args: `make format-check` (the ci.yaml `format` job and proxy.yml's format step, both already required) now runs `buildifier -mode=check -lint=warn -warnings=default` over every Starlark file git lists, proxy/ included without building that workspace; `make format` adds `-lint=fix`, which applies the mechanical fixes and stays exit 0 on what it cannot fix. Warning set: buildifier's `default`. `all` only adds opt-in categories, and the only one with findings is unsorted-dict-items (11 in 5 files, deliberately component-ordered dicts), kept off with the reason spelled out in bazel/format/BUILD.bazel. - Remove the vacuous buildifier aspect from --config=lint and linters.bzl, so no gate claims a check it does not run. - scripts/lint-proxy.sh drops its buildifier half (-warnings=all, a second warning set for one subtree) and is ShellCheck-only; comments, step names and the format-failure hint in ci.yaml/proxy.yml, the Makefile and the docs follow. Refs #1245 Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
The three findings the newly-wired linter reports on main: - bazel/img/go_multi_arch_image.bzl: module-docstring (none) and function-docstring-args (the "Parameters:" block is not recognised, documented a non-existent `tars`, and omitted container_test_configs and tars_layer). Docstring-only; no action changes. - charts/aether/BUILD.bazel: make-location in :chart_commit_yaml — $(location Chart.yaml) -> $(execpath Chart.yaml), identical expansion for a source file in a genrule cmd. Chart 2.4.6 -> 2.4.7 (the chart-version-bump gate counts any change under charts/aether/). Closes #1245 Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
bpalermo
force-pushed
the
fix/1245-buildifier-lint
branch
from
October 5, 2026 15:08
cdf7b8f to
4735e34
Compare
bpalermo
added a commit
that referenced
this pull request
Oct 5, 2026
…gets; pin cloud-provider-kind - e2e/soak/harness_test.sh (#1265, 34 offline cases) ran nowhere: it needed jq from the host. It is now //e2e/soak:harness_test, an sh_test with the Bazel-pinned jq (jq.bzl) put on PATH, so it runs in bazel test //... and in ci.yaml's test leg whenever the soak harness changes. - The shell jobs in ci.yaml and proxy.yml warmed @buildifier_prebuilt //:buildifier, which nothing in either job runs since scripts/lint-proxy.sh stopped running buildifier (#1256); --config=lint's aspects are buf, shellcheck and gocognit, and proxy.yml's //:format.check warm-up already covers the formatter's buildifier. - e2e.yaml installed sigs.k8s.io/cloud-provider-kind@latest (then run under sudo): pinned to v0.12.0, what @latest resolves to today. - Stale comments: ci.yaml's shell job ("17 source files" -> 70) and main.yaml's test job ("the proxy-ready linkage guard" -> five guards). Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
bpalermo
added a commit
that referenced
this pull request
Oct 5, 2026
…gets; pin cloud-provider-kind (#1279) - e2e/soak/harness_test.sh (#1265, 34 offline cases) ran nowhere: it needed jq from the host. It is now //e2e/soak:harness_test, an sh_test with the Bazel-pinned jq (jq.bzl) put on PATH, so it runs in bazel test //... and in ci.yaml's test leg whenever the soak harness changes. - The shell jobs in ci.yaml and proxy.yml warmed @buildifier_prebuilt //:buildifier, which nothing in either job runs since scripts/lint-proxy.sh stopped running buildifier (#1256); --config=lint's aspects are buf, shellcheck and gocognit, and proxy.yml's //:format.check warm-up already covers the formatter's buildifier. - e2e.yaml installed sigs.k8s.io/cloud-provider-kind@latest (then run under sudo): pinned to v0.12.0, what @latest resolves to today. - Stale comments: ci.yaml's shell job ("17 source files" -> 70) and main.yaml's test job ("the proxy-ready linkage guard" -> five guards). Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr Co-authored-by: Claude Fable 5.1 <[email protected]>
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.
Top of a 2-PR stack: stacked on #1255, which must merge first because it lets the formatter see the BUILD files at all.
Finding: confirmed
rules_lint 2.9.1's
lint_buildifier_aspectonly visitsbzl_library/bzl_library_ruletargets and filegroups taggedstarlarkorlint-with-buildifier.bazel query 'kind(bzl_library, //...) + attr(tags, "starlark|lint-with-buildifier", //...)'returns empty for this repository.Probe: a throwaway
bazel/lint/probe_dirty.bzlwith an unusedloadand no module docstring. Not committed.bazel build --config=lint --@aspect_rules_lint//lint:fail_on_violation //...exit 0.bazel aquery --config=lint //... --output=summaryshowsAspectRulesLintBuf: 12,AspectRulesLintShellCheck: 26and no Buildifier mnemonic. Run directly, buildifier flags both warnings with exit 4.bazel run //:format.checkexit 1, reportingprobe_dirty.bzl:1: module-docstringandprobe_dirty.bzl:1: load. The same probe underproxy/bazel/is caught too, without building the proxy workspace.Change
format_multirun'sstarlark_check_args/starlark_fix_args, so it runs in a gate CI already requires and no CI job is added:make format-check(ci.yaml'sformatjob and proxy.yml's format step) runsbuildifier -mode=check -lint=warn -warnings=defaultover every Starlark file git lists,proxy/included.make formatadds-lint=fix. That applies the mechanical fixes and still exits 0 on what it cannot fix; the check then reports those.--config=lintandbazel/lint/linters.bzlso no gate claims a check it does not run. With no bzl_library targets, and BUILD files unable to be srcs of a target in another package, there was no idiomatic way to make it visit them.scripts/lint-proxy.shis ShellCheck-only. Its buildifier half ran a second warning set (all) on one subtree;proxy/Starlark now gets the same check as everything else..github/workflows/ci.yamlandproxy.yml, the comments and step names that described lint-proxy's buildifier run are updated, and the format-failure message now mentions lint findings. No job, trigger or command changed.Warning set: buildifier
defaultCounts over all 171 Starlark files git lists (root + proxy):
defaultallselect()s and an aspect's attrs are ordered by component on purpose. The reason is recorded inbazel/format/BUILD.bazelThese are the only categories with findings, so
alladds nothing besides unsorted-dict-items.Fixes
Each is in its own commit:
bazel/img/go_multi_arch_image.bzl: added a module docstring. The docstring'sParameters:block was not recognised and also documented a non-existenttars, so it is now anArgs:block covering every argument. Docstring only.charts/aether/BUILD.bazel:$(location Chart.yaml)is now$(execpath Chart.yaml)in:chart_commit_yaml. The expansion is identical for a source file. Chart 2.4.6 -> 2.4.7, because the chart-version-bump gate counts any change undercharts/aether/.Verification
make format-check: exit 0, all 4 languagesbazel run //:format(fix mode): no further changesbazel build --config=lint --@aspect_rules_lint//lint:fail_on_violation //...: passesscripts/lint-proxy.sh: clean (4 shell files)scripts/check-chart-version-bump.sh origin/main: passesbazel test //bazel/... //charts/... //website:site_test: 74/74 passCloses #1245
🤖 Generated with Claude Code
https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr