Skip to content

Commit

Permalink
chore: replace black/flake8 with ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
liborjelinek committed Jun 21, 2024
1 parent dc63c3e commit 4a27152
Showing 1 changed file with 13 additions and 22 deletions.
35 changes: 13 additions & 22 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

[tox]
# we use any Python 3
envlist = py3,mypy,check_style
envlist = py3,mypy,ruff_test
skip_missing_interpreters=true

[testenv]
Expand All @@ -25,34 +25,25 @@ deps =
commands=
mypy sphinx_reredirects

[testenv:check_style]
description =
Run style checks. Do not modify files.
[testenv:ruff_fix]
description = Lint and format the code (modify files).
skip_install = True
deps =
isort==5.10.1
black==22.3.0
flake8==4.0.1
ruff
commands =
; import order compatible with black formatter
isort --check-only --diff --profile black sphinx_reredirects tests setup.py
black --check --diff sphinx_reredirects tests setup.py
; Make Flake8 linter compatible with Black formatter
; https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#flake8
flake8 --ignore E203 --max-line-length 88 sphinx_reredirects tests setup.py
ruff check --fix
ruff format

[testenv:fix_style]
description =
Run and fix style (modify files).
[testenv:ruff_test]
description = Check linting and formatting rules (do NOT modify files)
skip_install = True
deps =
isort==5.10.1
black==22.3.0
flake8==4.0.1
ruff
commands =
isort --profile black sphinx_reredirects tests setup.py
black sphinx_reredirects tests setup.py
flake8 --ignore E203 --max-line-length 88 sphinx_reredirects tests setup.py
; Fail even if violations were fixed
ruff check --exit-non-zero-on-fix
; Fail if not properly formatted (don't modify files)
ruff format --check

[testenv:docs]
description = Build docs
Expand Down

0 comments on commit 4a27152

Please sign in to comment.