Skip to content

Commit

Permalink
Replace black, flake8 and isort by ruff
Browse files Browse the repository at this point in the history
Easier to configure, faster.
  • Loading branch information
francoisfreitag committed Jul 16, 2024
1 parent f7765f4 commit c62859f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 25 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ jobs:
fail-fast: false
matrix:
tox-environment:
- black
- doctest
- flake8
- isort
- mypy
- ruff
env:
TOXENV: ${{ matrix.tox-environment }}

Expand Down
13 changes: 11 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,17 @@ Source = "https://github.com/stefanfoulis/django-phonenumber-field"
Tracker = "https://github.com/stefanfoulis/django-phonenumber-field/issues/"
Changelog = "https://github.com/stefanfoulis/django-phonenumber-field/releases/"

[tool.isort]
profile = "black"
[tool.ruff.lint]
# see prefixes in https://beta.ruff.rs/docs/rules/
select = [
"F", # pyflakes
"E", # pycodestyle errors
"W", # pycodestyle warnings
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehension
]


[build-system]
requires = [
Expand Down
23 changes: 3 additions & 20 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,11 @@ commands =
coverage html -d coverage-reports/html
coverage report

[testenv:black]
basepython = python3
[testenv:ruff]
commands =
black --target-version=py38 --check --diff .
ruff check
deps =
black
skip_install = true

[testenv:flake8]
commands =
flake8
deps =
flake8
flake8-bugbear
flake8-comprehensions
skip_install = true

[testenv:isort]
commands =
isort --check-only --diff .
deps =
isort>=5.0.2
ruff
skip_install = true

[testenv:doctest]
Expand Down

0 comments on commit c62859f

Please sign in to comment.