Skip to content

Commit e1a1ab0

Browse files
committed
bazel: add bazelisk run //:format to format all code
tweaks. Struggling with tclfmt that won't work if invoked from another directory than the source code directory. Signed-off-by: Øyvind Harboe <[email protected]>
1 parent bdbe5e9 commit e1a1ab0

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,7 @@ sh_binary(
3737
data = [
3838
":black",
3939
":tclfmt",
40+
# runfiles are not transitive dependencies, so we need to add this explicitly
41+
":tclint.toml",
4042
],
4143
)

etc/format.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
#!/bin/bash
2-
set -e
2+
set -ex
33
black=$1
44
shift
55
tclfmt=$1
66
shift
7-
$tclfmt --in-place ${BUILD_WORKSPACE_DIRECTORY}
8-
$black ${BUILD_WORKSPACE_DIRECTORY}
7+
8+
$black --check \
9+
--extend-exclude "(tools/OpenROAD/src/sta|\
10+
tools/yosys|\
11+
tools/yosys-slang)" \
12+
${BUILD_WORKSPACE_DIRECTORY}
13+
14+
# FIXME can't get it to work with our tclfmt config yet, it assumes that source is pwd
15+
# $tclfmt --config=${BUILD_WORKSPACE_DIRECTORY}/tclint.toml --check \
16+
# ${BUILD_WORKSPACE_DIRECTORY}

0 commit comments

Comments
 (0)