From f929597ae52dc67d31a3a1b99bab028b7e185eb6 Mon Sep 17 00:00:00 2001 From: mhostetter Date: Wed, 31 Jan 2024 18:54:14 -0500 Subject: [PATCH 1/2] Upgrade to Ruff v0.1.15 --- .pre-commit-config.yaml | 2 +- .vscode/settings.json | 2 +- requirements-dev.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e6720e7b1..076412235 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,7 +8,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.4 + rev: v0.1.15 hooks: - id: ruff - id: ruff-format diff --git a/.vscode/settings.json b/.vscode/settings.json index f8611a6fa..87516d437 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -10,7 +10,7 @@ "editor.formatOnSave": true, "editor.defaultFormatter": "charliermarsh.ruff", "editor.codeActionsOnSave": { - "source.organizeImports": true + "source.organizeImports": "explicit" }, }, "editor.formatOnSave": true, diff --git a/requirements-dev.txt b/requirements-dev.txt index ad5b14f2a..68dceb464 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,4 @@ -ruff == 0.1.4 +ruff == 0.1.15 pytest pytest-cov[toml] pytest-xdist From 4d7ab443183b7c8f081bfc915833d7471eb34a87 Mon Sep 17 00:00:00 2001 From: mhostetter Date: Wed, 31 Jan 2024 19:16:05 -0500 Subject: [PATCH 2/2] Add `pylint` rules in Ruff --- pyproject.toml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b621d7bdd..c553b3988 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -93,9 +93,23 @@ select = [ "UP", # pyupgrade "B", # flake8-bugbear # "SIM",# flake8-simplify - "I", # isort + "I", # isort + "PL", # pylint +] +ignore = [ + "E501", # line-too-long + "E713", # not-in-test + "E714", # not-is-test + "E741", # ambiguous-variable-name + "PLR0911", # too-many-return-statements + "PLR0912", # too-many-branches + "PLR0913", # too-many-arguments + "PLR0915", # too-many-statements + "PLR2004", # magic-value-comparison + "PLR5501", # collapsible-else-if + "PLW0603", # global-statement + "PLW2901", # redefined-loop-name ] -ignore = ["E501", "E713", "E714", "E741"] [tool.ruff.lint.per-file-ignores] "__init__.py" = ["F401", "F403"]