Skip to content

Commit e3a9a30

Browse files
committed
bazel: pass git to lint scripts in fix_lint
tcl_lint_test.sh and bzl_lint_test.sh take the git binary as their second argument (as their sh_test wrappers pass it), but //:fix_lint invoked them with only the lint tool, so 'bazelisk run //:fix_lint' always failed with '$2: unbound variable'. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
1 parent 5809d12 commit e3a9a30

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,7 @@ sh_binary(
666666
"$(rootpath @buildifier_prebuilt//:buildifier)",
667667
"$(rootpath //bazel:bzl_lint_test.sh)",
668668
"$(rootpath @buildifier_prebuilt//:buildifier)",
669+
"$(rootpath @git)",
669670
],
670671
data = [
671672
"MODULE.bazel",
@@ -677,5 +678,6 @@ sh_binary(
677678
"//bazel:tclfmt",
678679
"//bazel:tclint",
679680
"@buildifier_prebuilt//:buildifier",
681+
"@git",
680682
],
681683
)

bazel/fix_lint.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ export BUILD_WORKSPACE_DIRECTORY="${BUILD_WORKSPACE_DIRECTORY:-$PWD}"
1010

1111
# TCL: auto-format then lint
1212
"$1" "$2"
13-
"$3" "$4" || rc=$?
13+
"$3" "$4" "$9" || rc=$?
1414

1515
# Bazel: auto-format then lint
1616
"$5" "$6"
17-
"$7" "$8" || rc=$?
17+
"$7" "$8" "$9" || rc=$?
1818

1919
git -C "$BUILD_WORKSPACE_DIRECTORY" status
2020

0 commit comments

Comments
 (0)