File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,8 +11,13 @@ TOOL="$(cd "$(dirname "$1")" && pwd)/$(basename "$1")"
1111[ -L MODULE.bazel ] || { echo " MODULE.bazel missing from runfiles" >&2 ; exit 1; }
1212WORKSPACE=" $( dirname " $( readlink MODULE.bazel) " ) "
1313cd " $WORKSPACE "
14- # `git ls-files` skips submodule contents (src/sta, third-party/abc).
14+ # `-c submodule.recurse=false` keeps git ls-files from descending into
15+ # submodules (src/sta, third-party/abc, third-party/slang-elab and the
16+ # fmt sub-submodule nested in it) — we never want to reformat files
17+ # owned by another repo. The override is needed because CI sets
18+ # submodule.recurse=true globally.
1519# Explicit -mode=check -lint=off separates format errors from lint warnings,
1620# and overrides the repo-root .buildifier.json default (mode: fix).
17- git ls-files ' *.bazel' ' *.bzl' ' **/BUILD' ' BUILD' ' **/WORKSPACE' ' WORKSPACE' -z \
21+ git -c submodule.recurse=false ls-files \
22+ ' *.bazel' ' *.bzl' ' **/BUILD' ' BUILD' ' **/WORKSPACE' ' WORKSPACE' -z \
1823 | xargs -0 " $TOOL " -mode=check -lint=off
Original file line number Diff line number Diff line change @@ -11,8 +11,12 @@ TOOL="$(cd "$(dirname "$1")" && pwd)/$(basename "$1")"
1111[ -L MODULE.bazel ] || { echo " MODULE.bazel missing from runfiles" >&2 ; exit 1; }
1212WORKSPACE=" $( dirname " $( readlink MODULE.bazel) " ) "
1313cd " $WORKSPACE "
14- # `git ls-files` skips submodule contents (src/sta, third-party/abc), so
15- # we never try to reformat files owned by another repo.
14+ # `-c submodule.recurse=false` keeps git ls-files from descending into
15+ # submodules (src/sta, third-party/abc, third-party/slang-elab and the
16+ # fmt sub-submodule nested in it) — we never want to reformat files
17+ # owned by another repo. The override is needed because CI sets
18+ # submodule.recurse=true globally.
1619# Explicit -mode=check overrides the repo-root .buildifier.json default.
17- git ls-files ' *.bazel' ' *.bzl' ' **/BUILD' ' BUILD' ' **/WORKSPACE' ' WORKSPACE' -z \
20+ git -c submodule.recurse=false ls-files \
21+ ' *.bazel' ' *.bzl' ' **/BUILD' ' BUILD' ' **/WORKSPACE' ' WORKSPACE' -z \
1822 | xargs -0 " $TOOL " -mode=check -lint=warn
Original file line number Diff line number Diff line change 66set -euo pipefail
77TOOL=" $( cd " $( dirname " $1 " ) " && pwd) /$( basename " $1 " ) "
88cd " ${BUILD_WORKSPACE_DIRECTORY:- $PWD } "
9- # `git ls-files` skips submodule contents (src/sta, third-party/abc),
10- # so we never rewrite files owned by another repo.
11- git ls-files ' *.bazel' ' *.bzl' ' **/BUILD' ' BUILD' ' **/WORKSPACE' ' WORKSPACE' -z \
9+ # `-c submodule.recurse=false` keeps git ls-files from descending into
10+ # submodules (src/sta, third-party/abc, third-party/slang-elab and the
11+ # fmt sub-submodule nested in it) — we never want to rewrite files
12+ # owned by another repo. The override is needed because CI sets
13+ # submodule.recurse=true globally.
14+ git -c submodule.recurse=false ls-files \
15+ ' *.bazel' ' *.bzl' ' **/BUILD' ' BUILD' ' **/WORKSPACE' ' WORKSPACE' -z \
1216 | xargs -0 " $TOOL " -mode=fix -lint=fix
You can’t perform that action at this time.
0 commit comments