Skip to content

Commit 128c06a

Browse files
committed
Run test_lint.sh in CI
`test_lint.sh` now contains tests to lint `MODULE.bazel` files, so this runs the script in CI instead of just //tools:lint_check.
1 parent 554a2d1 commit 128c06a

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

.bazelci/presubmit.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,10 @@ tasks:
102102
shell_commands:
103103
- "./test_cross_build.sh"
104104
lint_linux:
105-
name: "bazel //tools:lint_check"
105+
name: "./test_lint.sh"
106106
platform: ubuntu2004
107-
run_targets:
108-
- "//tools:lint_check"
107+
shell_commands:
108+
- "./test_lint.sh"
109109
test_rules_scala_jdk21:
110110
name: "./test_rules_scala with jdk21"
111111
platform: ubuntu2004

test/shell/test_bzlmod_tidy.sh

+6-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
66
rootdir="$(cd "${dir}/../.." && pwd)"
77
. "${dir}"/test_runner.sh
88
runner=$(get_test_runner "${1:-local}")
9+
test_tmpdir="${rootdir}/tmp/lint"
10+
mkdir -p "$test_tmpdir"
911

1012
check_module_bazel() {
1113
local repo_path="${1%MODULE.bazel}"
12-
local mod_orig="${rootdir}/tmp/MODULE.lint"
13-
local mod_diff="${rootdir}/tmp/MODULE.diff"
14+
local mod_orig="${test_tmpdir}/MODULE.lint"
15+
local mod_diff="${test_tmpdir}/MODULE.diff"
1416

1517
echo -e "${GREEN}INFO:${NC} linting $1"
1618
repo_path="${repo_path:-.}"
@@ -33,3 +35,5 @@ check_module_bazel() {
3335
while IFS= read -r module_file; do
3436
$runner check_module_bazel "$module_file"
3537
done < <(git ls-files '**MODULE.bazel')
38+
39+
rm -rf "${test_tmpdir}"

0 commit comments

Comments
 (0)