File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -584,10 +584,14 @@ sh_test(
584584sh_binary (
585585 name = "tidy_tcl" ,
586586 srcs = ["//bazel:tcl_tidy.sh" ],
587- args = ["$(rootpath //bazel:tclfmt)" ],
587+ args = [
588+ "$(rootpath //bazel:tclfmt)" ,
589+ "$(rootpath @git)" ,
590+ ],
588591 data = [
589592 "tclint.toml" ,
590593 "//bazel:tclfmt" ,
594+ "@git" ,
591595 ],
592596)
593597
@@ -633,9 +637,13 @@ sh_test(
633637sh_binary (
634638 name = "tidy_bzl" ,
635639 srcs = ["//bazel:bzl_tidy.sh" ],
636- args = ["$(rootpath @buildifier_prebuilt//:buildifier)" ],
640+ args = [
641+ "$(rootpath @buildifier_prebuilt//:buildifier)" ,
642+ "$(rootpath @git)" ,
643+ ],
637644 data = [
638645 "@buildifier_prebuilt//:buildifier" ,
646+ "@git" ,
639647 ],
640648)
641649
Original file line number Diff line number Diff line change 55# Auto-format all Bazel files in-place using buildifier.
66set -euo pipefail
77TOOL=" $( cd " $( dirname " $1 " ) " && pwd) /$( basename " $1 " ) "
8+ GIT=" $( realpath " $2 " ) "
89cd " ${BUILD_WORKSPACE_DIRECTORY:- $PWD } "
910# `-c submodule.recurse=false` keeps git ls-files from descending into
1011# submodules (src/sta, third-party/abc, third-party/slang-elab and the
1112# fmt sub-submodule nested in it) — we never want to rewrite files
1213# owned by another repo. The override is needed because CI sets
1314# submodule.recurse=true globally.
14- git -c submodule.recurse=false ls-files \
15+ " ${GIT} " -c submodule.recurse=false ls-files \
1516 ' *.bazel' ' *.bzl' ' **/BUILD' ' BUILD' ' **/WORKSPACE' ' WORKSPACE' -z \
1617 | xargs -0 " $TOOL " -mode=fix -lint=fix
Original file line number Diff line number Diff line change @@ -17,13 +17,12 @@ BZL_LINT_BUILDIFIER="$8"
1717GIT=" $9 "
1818
1919export BUILD_WORKSPACE_DIRECTORY=" ${BUILD_WORKSPACE_DIRECTORY:- $PWD } "
20-
2120# TCL: auto-format then lint
22- " ${TCL_TIDY_SH} " " ${TCLFMT} "
21+ " ${TCL_TIDY_SH} " " ${TCLFMT} " " ${GIT} "
2322" ${TCL_LINT_SH} " " ${TCLINT} " " ${GIT} " || rc=$?
2423
2524# Bazel: auto-format then lint
26- " ${BZL_TIDY_SH} " " ${BZL_FMT_BUILDIFIER} "
25+ " ${BZL_TIDY_SH} " " ${BZL_FMT_BUILDIFIER} " " ${GIT} "
2726" ${BZL_LINT_SH} " " ${BZL_LINT_BUILDIFIER} " " ${GIT} " || rc=$?
2827
2928" ${GIT} " -C " $BUILD_WORKSPACE_DIRECTORY " status
Original file line number Diff line number Diff line change 66
77set -euo pipefail
88
9- TOOL=" $( realpath " $1 " ) "
9+ TOOL=" $( cd " $( dirname " $1 " ) " && pwd ) / $( basename " $1 " ) "
1010GIT=" $( realpath " $2 " ) "
1111
1212WORKSPACE=" $( dirname " $( readlink -f tclint.toml) " ) "
Original file line number Diff line number Diff line change 55# Auto-format all TCL files in-place.
66set -euo pipefail
77TOOL=" $( cd " $( dirname " $1 " ) " && pwd) /$( basename " $1 " ) "
8+ GIT=" $( realpath " $2 " ) "
89cd " ${BUILD_WORKSPACE_DIRECTORY:- $PWD } "
9- git ls-files ' *.tcl' -z | xargs -0 " $TOOL " --in-place
10+ " ${GIT} " ls-files ' *.tcl' -z | xargs -0 " $TOOL " --in-place
You can’t perform that action at this time.
0 commit comments