diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 763b5500..ab578e3a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,12 +14,12 @@ repos: hooks: - id: black - repo: https://github.com/tox-dev/tox-ini-fmt - rev: "1.3.0" + rev: "1.3.1" hooks: - id: tox-ini-fmt args: ["-p", "fix"] - repo: https://github.com/tox-dev/pyproject-fmt - rev: "0.11.2" + rev: "0.12.0" hooks: - id: pyproject-fmt additional_dependencies: ["tox>=4.6"] diff --git a/pyproject.toml b/pyproject.toml index cc550532..3856d30b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -71,6 +71,28 @@ version.source = "vcs" [tool.black] line-length = 120 +[tool.ruff] +select = ["ALL"] +line-length = 120 +target-version = "py37" +isort = {known-first-party = ["tox", "tests"], required-imports = ["from __future__ import annotations"]} +ignore = [ + "ANN101", # no typoe annotation for self + "ANN401", # allow Any as type annotation + "D203", # `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible + "D212", # `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible + "S104", # Possible binding to all interface +] +[tool.ruff.per-file-ignores] +"tests/**/*.py" = [ + "S101", # asserts allowed in tests... + "FBT", # don"t care about booleans as positional arguments in tests + "INP001", # no implicit namespace + "D", # don"t care about documentation in tests + "S603", # `subprocess` call: check for execution of untrusted input + "PLR2004", # Magic value used in comparison, consider replacing with a constant variable +] + [tool.pytest.ini_options] testpaths = ["tests"] @@ -95,25 +117,3 @@ python_version = "3.10" strict = true exclude = "^(.*/roots/.*)|(tests/test_integration.py)$" overrides = [{ module = ["sphobjinv.*"], ignore_missing_imports = true }] - -[tool.ruff] -select = ["ALL"] -line-length = 120 -target-version = "py37" -isort = {known-first-party = ["tox", "tests"], required-imports = ["from __future__ import annotations"]} -ignore = [ - "ANN101", # no typoe annotation for self - "ANN401", # allow Any as type annotation - "D203", # `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible - "D212", # `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible - "S104", # Possible binding to all interface -] -[tool.ruff.per-file-ignores] -"tests/**/*.py" = [ - "S101", # asserts allowed in tests... - "FBT", # don"t care about booleans as positional arguments in tests - "INP001", # no implicit namespace - "D", # don"t care about documentation in tests - "S603", # `subprocess` call: check for execution of untrusted input - "PLR2004", # Magic value used in comparison, consider replacing with a constant variable -]