From d859c6147986681b03167a0921af00431d4ccc46 Mon Sep 17 00:00:00 2001 From: Constantin Gahr Date: Tue, 2 Apr 2024 10:31:13 +0200 Subject: [PATCH] fix pre-commit errors caused by ruff update --- .pre-commit-config.yaml | 2 +- pyproject.toml | 107 +++++++++++++++++++--------------------- 2 files changed, 53 insertions(+), 56 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2f492ea..7cb2dc1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,7 +29,7 @@ repos: - id: pytest name: pytest entry: pytest - language: conda + language: python pass_filenames: false always_run: true fail_fast: true diff --git a/pyproject.toml b/pyproject.toml index 820638b..12f748a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,9 +46,6 @@ Changelog = "https://github.com/cgahr/latexplotlib/blob/main/CHANGES.md" Homepage = "https://github.com/cgahr/latexplotlib" Issues = "https://github.com/cgahr/latexplotlib/issues" -[tool.black] -line_length = 88 - [tool.coverage.report] exclude_lines = ["if TYPE_CHECKING:"] @@ -58,6 +55,58 @@ source = ["src"] [tool.isort] profile = "black" +[tool.lint.ruff] +fix = true +fixable = ["I"] +ignore = [ + "ANN101" # missing-type-self +] +select = [ + "A", + "ANN", + "ARG", + "B", + "BLE", + "C4", + "C90", + "DTZ", + "E", + "EM", + "ERA", + "EXE", + "F", + "FBT", # unclear if good or not + "G", + "I", + "ICN", + "INP", + "ISC", + "N", + "NPY", + "PGH", + "PIE", + "PL", + "PT", + "PTH", + "PYI", + "RET", + "RSE", + "RUF", + "S", + "SIM", + "SLF", + "T10", + "T20", + "TCH", + "TID", + "TRY", + # "D", + "UP", + "W", + "YTT" +] +target-version = "py38" + [tool.mypy] check_untyped_defs = true exclude = [ @@ -93,58 +142,6 @@ testpaths = [ "tests" ] -[tool.ruff] -fix = true -fixable = ["I"] -ignore = [ - "ANN101" # missing-type-self -] -select = [ - "F", - "E", - "W", - "C90", - "I", - "N", - # "D", - "UP", - "YTT", - "ANN", - "S", - "BLE", - "FBT", # unclear if good or not - "B", - "A", - "C4", - "DTZ", - "T10", - "EM", - "EXE", - "ISC", - "ICN", - "G", - "INP", - "PIE", - "T20", - "PYI", - "PT", - "RSE", - "RET", - "SLF", - "SIM", - "TID", - "TCH", - "ARG", - "PTH", - "ERA", - "PGH", - "PL", - "TRY", - "NPY", - "RUF" -] -target-version = "py38" - [tool.ruff.flake8-annotations] suppress-dummy-args = true