From d5a6605198d0a24f6dab8016c18bc13e0d72207c Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 20 Mar 2023 17:40:01 +0100 Subject: [PATCH] Make changes requested in code review --- .pre-commit-config.yaml | 2 +- .ruff.toml | 32 +++++++++++++++++++++++--------- setup.cfg | 12 ------------ tox.ini | 4 ++-- 4 files changed, 26 insertions(+), 24 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b1506c68..cb3c1e2a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,4 +14,4 @@ repos: rev: v0.0.253 hooks: - id: ruff - # args: [--fix, --exit-non-zero-on-fix] + args: [--fix, --exit-non-zero-on-fix, --show-fixes] diff --git a/.ruff.toml b/.ruff.toml index f285d165..87f624d5 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -6,16 +6,30 @@ exclude = [ "ci/templates", "dist", ] -line-length = 140 -select = [ - "E", - "F", - "I", - "PLC", - "PLE", - "UP", - "W", +ignore = [ + "D", # pydocstyle + "ANN", # flake8-annotations + "ARG", # flake8-unused-arguments + "BLE", # flake8-blind-except + "C90", # mccabe + "EM", # flake8-errmsg + "FBT", # flake8-boolean-trap + "INP", # flake8-no-pep420 + "PLR", # Pylint Refactor + "PLW", # Pylint Warning + "Q", # flake8-quotes + "RET", # flake8-return + "SIM102", # flake8-simplify collapsible-if + "SIM105", # flake8-simplify use-contextlib-suppress + "SLF", # flake8-self + "T20", # flake8-print + "S101", # flake8-bandit assert + "S102", # flake8-bandit exec + "S110", # flake8-bandit try-except-pass + "TRY", # tryceratops ] +line-length = 140 +select = ["ALL"] target-version = "py37" # [tool.ruff.isort] # <- TODO Uncomment when migrating to pyproject.toml diff --git a/setup.cfg b/setup.cfg index 360a416d..268333ec 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,7 +1,3 @@ -[flake8] -max-line-length = 140 -exclude = .tox,.eggs,ci/templates,build,dist - [tool:pytest] testpaths = tests python_files = test_*.py @@ -9,11 +5,3 @@ addopts = -ra --strict -p pytester - -[tool:isort] -force_single_line = True -line_length = 120 -known_first_party = pytest_cov -default_section = THIRDPARTY -forced_separate = test_pytest_cov -skip = .tox,.eggs,ci/templates,build,dist diff --git a/tox.ini b/tox.ini index aeccd9de..fe1c20cc 100644 --- a/tox.ini +++ b/tox.ini @@ -93,14 +93,14 @@ deps = check-manifest colorama # TODO Remove when isort > v6.0.0b2 is released. docutils - flake8 isort pygments readme-renderer + ruff skip_install = true usedevelop = false commands = python setup.py check --strict --metadata --restructuredtext check-manifest {toxinidir} - flake8 src tests setup.py + ruff . isort --check-only --diff src tests setup.py