Skip to content

Commit e72a1c9

Browse files
committed
bazel: name fix_lint.sh parameters
Review feedback: assign the positional parameters to named variables, matching the style of the per-language lint scripts, and use the passed git for the final status report. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
1 parent e3a9a30 commit e72a1c9

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

bazel/fix_lint.sh

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,27 @@
66
# that file-discovery logic is not duplicated (DRY).
77
set -euo pipefail
88

9+
TCL_TIDY_SH="$1"
10+
TCLFMT="$2"
11+
TCL_LINT_SH="$3"
12+
TCLINT="$4"
13+
BZL_TIDY_SH="$5"
14+
BZL_FMT_BUILDIFIER="$6"
15+
BZL_LINT_SH="$7"
16+
BZL_LINT_BUILDIFIER="$8"
17+
GIT="$9"
18+
919
export BUILD_WORKSPACE_DIRECTORY="${BUILD_WORKSPACE_DIRECTORY:-$PWD}"
1020

1121
# TCL: auto-format then lint
12-
"$1" "$2"
13-
"$3" "$4" "$9" || rc=$?
22+
"${TCL_TIDY_SH}" "${TCLFMT}"
23+
"${TCL_LINT_SH}" "${TCLINT}" "${GIT}" || rc=$?
1424

1525
# Bazel: auto-format then lint
16-
"$5" "$6"
17-
"$7" "$8" "$9" || rc=$?
26+
"${BZL_TIDY_SH}" "${BZL_FMT_BUILDIFIER}"
27+
"${BZL_LINT_SH}" "${BZL_LINT_BUILDIFIER}" "${GIT}" || rc=$?
1828

19-
git -C "$BUILD_WORKSPACE_DIRECTORY" status
29+
"${GIT}" -C "$BUILD_WORKSPACE_DIRECTORY" status
2030

2131
if [ "${rc:-0}" -ne 0 ]; then
2232
echo "Error: lint violations remain that require manual fixes." >&2

0 commit comments

Comments
 (0)