Skip to content

Commit 90a5857

Browse files
Update scripts/format.sh
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 75f58e8 commit 90a5857

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

scripts/format.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,12 @@ echo "$CHANGED_FILES"
2727

2828
# Formatters are already installed in the activated venv from the GHA step.
2929
# Use xargs to pass the file list to the formatters.
30-
echo "$CHANGED_FILES" | xargs -r no_implicit_optional --use-union-or
31-
echo "$CHANGED_FILES" | xargs -r pyupgrade --exit-zero-even-if-changed --py310-plus
32-
echo "$CHANGED_FILES" | xargs -r autoflake -i -r --remove-all-unused-imports
33-
echo "$CHANGED_FILES" | xargs -r ruff check --fix-only
34-
echo "$CHANGED_FILES" | xargs -r ruff format
30+
run_formatter() {
31+
echo "$CHANGED_FILES" | xargs -r "$@"
32+
}
33+
34+
run_formatter no_implicit_optional --use-union-or
35+
run_formatter pyupgrade --exit-zero-even-if-changed --py310-plus
36+
run_formatter autoflake -i -r --remove-all-unused-imports
37+
run_formatter ruff check --fix-only
38+
run_formatter ruff format

0 commit comments

Comments
 (0)