Repository navigation
feat(lint): add buildifier linting for Starlark files - #1271
Open
LittleHuba wants to merge 3 commits into
Open
LittleHuba wants to merge 3 commits into
LittleHuba wants to merge 3 commits into
Conversation
LittleHuba
requested review from
bemerybmw,
castler,
crimson11,
hoe-jo and
limdor
as code owners
October 5, 2026 07:53
|
|
||
| import io | ||
| import json | ||
| import unittest |
Contributor
Author
LittleHuba
force-pushed
the
split/1-lint-infra
branch
from
October 21, 2026 11:25
b16e649 to
4ffe51e
Compare
LittleHuba
added this pull request to stack #1421
October 21, 2026 11:26
Add //:buildifier.check and //:buildifier.fix, which accept Bazel-style package patterns (including `-` exclusions) like the other linters, and a gating //:buildifier_test. A dedicated CI job converts the findings to SARIF (//tools/lint:buildifier_sarif), uploads them to Code Scanning and fails on findings. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
With --format=json buildifier exits 0 and flags syntax errors (valid=false) and unformatted files (formatted=false) without any warning entry, so they were missing from the SARIF output and could not fail the job. Report them as syntax-error/reformat results and treat all findings as errors, as buildifier has no severity levels. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
LittleHuba
force-pushed
the
split/1-lint-infra
branch
from
October 21, 2026 11:39
4ffe51e to
aea13f5
Compare
limdor
reviewed
Oct 21, 2026
| We chose ruff because it is fast, and it has a good set of default checks. | ||
| Runs the [ruff checks](./.ruff.toml) for the host. | ||
|
|
||
| #### Linting for Bazel files |
Contributor
There was a problem hiding this comment.
I think this can be removed because it should already be covered by https://github.com/eclipse-score/communication/blob/main/CI.md#formatting-and-linting-of-bazel-files
| if: inputs.fetch-only != 'true' | ||
| run: | | ||
| bazel run --config=ci --ui_event_filters=-info,-stdout --noshow_progress \ | ||
| //tools/lint:buildifier_sarif > buildifier.sarif |
Contributor
There was a problem hiding this comment.
Write to file, @LittleHuba know what that means :-)
| > **Note:** Violations without an automatic fix are still reported in the terminal but leave no | ||
| > patch file, same as Clang-Tidy. | ||
|
|
||
| ### Buildifier |
Contributor
There was a problem hiding this comment.
We should take a look how this plays along with
https://github.com/eclipse-score/communication/blob/main/CI.md#formatting-and-linting-of-bazel-files
This branch has not been deployed
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.
Adds buildifier linting infrastructure (lint aspect, SARIF conversion, CI integration) and bumps action versions in the linter workflow. Split out of #1255; contains no BUILD/bzl fixes.