From 2b2db9e23135c0e9d7bca840989f1a47a19420aa Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Mon, 2 Sep 2024 11:52:30 +0200 Subject: [PATCH] Run `ruff format` in CI --- .github/workflows/fix_lint.yaml | 6 +++++- .github/workflows/tests.yml | 5 ++++- scripts-dev/lint.sh | 3 +++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/fix_lint.yaml b/.github/workflows/fix_lint.yaml index 5970b4e826..909b0a847f 100644 --- a/.github/workflows/fix_lint.yaml +++ b/.github/workflows/fix_lint.yaml @@ -29,10 +29,14 @@ jobs: with: install-project: "false" - - name: Run ruff + - name: Run ruff check continue-on-error: true run: poetry run ruff check --fix . + - name: Run ruff format + continue-on-error: true + run: poetry run ruff format --quiet . + - run: cargo clippy --all-features --fix -- -D warnings continue-on-error: true diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index add046ec6a..5586bd6d94 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -131,9 +131,12 @@ jobs: with: install-project: "false" - - name: Check style + - name: Run ruff check run: poetry run ruff check --output-format=github . + - name: Run ruff format + run: poetry run ruff format --check . + lint-mypy: runs-on: ubuntu-latest name: Typechecking diff --git a/scripts-dev/lint.sh b/scripts-dev/lint.sh index fa6ff90708..c656047729 100755 --- a/scripts-dev/lint.sh +++ b/scripts-dev/lint.sh @@ -109,6 +109,9 @@ set -x # --quiet suppresses the update check. ruff check --quiet --fix "${files[@]}" +# Reformat Python code. +ruff format --quiet "${files[@]}" + # Catch any common programming mistakes in Rust code. # # --bins, --examples, --lib, --tests combined explicitly disable checking