Skip to content

Commit 022b990

Browse files
authored
Merge pull request #73 from dtolnay/buildifier
Run Buildifier in CI
2 parents b2aff31 + 80240ce commit 022b990

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

.github/workflows/lint.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,19 @@ jobs:
3939
- uses: actions/checkout@v4
4040
- uses: dtolnay/install-buck2@latest
4141
- run: git ls-files '*.bzl' '*.bxl' | xargs buck2 starlark lint
42+
43+
buildifier:
44+
name: Buildifier
45+
needs: pre_ci
46+
if: needs.pre_ci.outputs.continue
47+
runs-on: ubuntu-latest
48+
timeout-minutes: 45
49+
steps:
50+
- uses: actions/checkout@v4
51+
- run: go install github.com/bazelbuild/buildtools/buildifier@latest
52+
- run: echo $(go env GOPATH)/bin >> $GITHUB_PATH
53+
- run: git ls-files '*.bzl' | xargs buildifier
54+
- run: git ls-files '*/BUCK' BUCK_TREE | xargs -n1 buildifier -path BUILD.bazel -lint fix
55+
- run: git ls-files '*.bxl' | xargs -n1 buildifier -path script.bzl -lint fix
56+
- name: Check that buildifier wanted no changes
57+
run: git diff --exit-code

BUCK_TREE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ set_cfg_constructor(
2222
linux = "prelude//os/constraints:linux",
2323
macos = "prelude//os/constraints:macos",
2424
windows = "prelude//os/constraints:windows",
25-
),
25+
), # buildifier: leave-alone
2626
extra_data = struct(),
2727
key = MODIFIER_METADATA_KEY,
2828
stage0 = cfg_constructor_pre_constraint_analysis,

0 commit comments

Comments
 (0)