From c62859fa5c1ebdb51cf83798b34b030b2401b21c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Freitag?= Date: Tue, 16 Jul 2024 10:34:27 +0200 Subject: [PATCH] Replace black, flake8 and isort by ruff Easier to configure, faster. --- .github/workflows/check.yml | 4 +--- pyproject.toml | 13 +++++++++++-- tox.ini | 23 +++-------------------- 3 files changed, 15 insertions(+), 25 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 70b7e19a..4bb41d6f 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -13,11 +13,9 @@ jobs: fail-fast: false matrix: tox-environment: - - black - doctest - - flake8 - - isort - mypy + - ruff env: TOXENV: ${{ matrix.tox-environment }} diff --git a/pyproject.toml b/pyproject.toml index ed5970e7..b274b40d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 = [ diff --git a/tox.ini b/tox.ini index f6792e87..dec32dc5 100644 --- a/tox.ini +++ b/tox.ini @@ -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]