Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace isort and black with ruff #17620

Merged
merged 4 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions .github/workflows/fix_lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,9 @@ jobs:
with:
install-project: "false"

- name: Import order (isort)
- name: Run ruff
continue-on-error: true
run: poetry run isort .

- name: Code style (black)
continue-on-error: true
run: poetry run black .

- name: Semantic checks (ruff)
continue-on-error: true
run: poetry run ruff --fix .
run: poetry run ruff check --fix .

- run: cargo clippy --all-features --fix -- -D warnings
continue-on-error: true
Expand All @@ -49,4 +41,4 @@ jobs:

- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Attempt to fix linting"
commit_message: "Attempt to fix linting"
11 changes: 2 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,8 @@ jobs:
with:
install-project: "false"

- name: Import order (isort)
run: poetry run isort --check --diff .

- name: Code style (black)
run: poetry run black --check --diff .

- name: Semantic checks (ruff)
# --quiet suppresses the update check.
run: poetry run ruff check --quiet .
- name: Check style
run: poetry run ruff check --output-format=github .

lint-mypy:
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions changelog.d/17620.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Replace `isort` and `black with `ruff`.
4 changes: 1 addition & 3 deletions docs/code_style.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ errors in code.

The necessary tools are:

- [black](https://black.readthedocs.io/en/stable/), a source code formatter;
- [isort](https://pycqa.github.io/isort/), which organises each file's imports;
- [ruff](https://github.com/charliermarsh/ruff), which can spot common errors; and
- [ruff](https://github.com/charliermarsh/ruff), which can spot common errors and enforce a consistent style; and
- [mypy](https://mypy.readthedocs.io/en/stable/), a type checker.

See [the contributing guide](development/contributing_guide.md#run-the-linters) for instructions
Expand Down
126 changes: 20 additions & 106 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading