Skip to content

Commit abc7d28

Browse files
committed
Add bazel tidying/linting exclusions for slang-elab
Assisted-by: Claude (various models) Signed-off-by: Martin Povišer <povik@cutebit.org>
1 parent 7da01e5 commit abc7d28

3 files changed

Lines changed: 21 additions & 8 deletions

File tree

bazel/bzl_fmt_test.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff 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; }
1212
WORKSPACE="$(dirname "$(readlink MODULE.bazel)")"
1313
cd "$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

bazel/bzl_lint_test.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff 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; }
1212
WORKSPACE="$(dirname "$(readlink MODULE.bazel)")"
1313
cd "$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

bazel/bzl_tidy.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66
set -euo pipefail
77
TOOL="$(cd "$(dirname "$1")" && pwd)/$(basename "$1")"
88
cd "${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

0 commit comments

Comments
 (0)