Skip to content

Commit 244a281

Browse files
authored
Run ruff format twice in make style (#1893)
There was an issue where `ruff check --fix` will fail on too long files before `ruff format` has a chance to fix them. To fix this, we now call `ruff format` before `ruff check --fix` but we also run formatting a second in case the lint fix introduces formatting issues. Signed-off-by: Fynn Schmitt-Ulms <[email protected]>
1 parent 815a4ff commit 244a281

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,13 @@ quality:
2828
ruff format --check $(CHECKDIRS);
2929

3030
# style the code according to accepted standards for the repo
31+
# Note: We run `ruff format` twice. Once to fix long lines before lint check
32+
# and again to fix any formatting issues introduced by ruff check --fix
3133
style:
3234
@echo "Running python styling";
35+
ruff format $(CHECKDIRS);
3336
ruff check --fix $(CHECKDIRS);
34-
ruff format $(CHECKDIRS);
37+
ruff format --silent $(CHECKDIRS);
3538

3639
# run tests for the repo
3740
test:

0 commit comments

Comments
 (0)