Skip to content

Commit 11d27ad

Browse files
committed
Make lint script return non-zero upon any change
So that the CI fails when reformatting needed to occur.
1 parent b6fad93 commit 11d27ad

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

bin/lint.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,19 @@ dir=$(dirname "$0")
44
cd "$dir/.."
55

66
exitCode=0
7+
8+
# Check for errors and capture non-zero exit codes.
79
uv run validate-pyproject pyproject.toml
810
code=$?; test $code -eq 0 || exitCode=$code
11+
uv run ruff check >/dev/null 2>&1
12+
code=$?; test $code -eq 0 || exitCode=$code
13+
uv run ruff format --check >/dev/null 2>&1
14+
code=$?; test $code -eq 0 || exitCode=$code
15+
16+
# Do actual code reformatting.
917
uv run ruff check --fix
1018
code=$?; test $code -eq 0 || exitCode=$code
1119
uv run ruff format
1220
code=$?; test $code -eq 0 || exitCode=$code
21+
1322
exit $exitCode

0 commit comments

Comments
 (0)