From b8bd3cb802849b22935ab37a048930a45ea90709 Mon Sep 17 00:00:00 2001 From: zacharyburnett Date: Sat, 25 Mar 2023 11:35:44 -0400 Subject: [PATCH 1/2] use `ruff` for linting --- .flake8 | 9 --------- .pre-commit-config.yaml | 8 ++++---- pyproject.toml | 12 +++++++++++- 3 files changed, 15 insertions(+), 14 deletions(-) delete mode 100644 .flake8 diff --git a/.flake8 b/.flake8 deleted file mode 100644 index 354a44b48..000000000 --- a/.flake8 +++ /dev/null @@ -1,9 +0,0 @@ -# flake8 does not support pyproject.toml (https://github.com/PyCQA/flake8/issues/234) - -[flake8] -max-line-length = 99 -ignore = -# W504: Line break occurred after a binary operator - W504, -# E741: Do not use variables named 'I', 'O', or 'l' - E741 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 407d386a5..23b37b860 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,8 +13,8 @@ repos: hooks: - id: isort name: isort (python) -- repo: https://github.com/pycqa/flake8 - rev: 6.0.0 +- repo: https://github.com/charliermarsh/ruff-pre-commit + rev: 'v0.0.257' hooks: - - id: flake8 - exclude: ^(asv/extern|test/example_results/cheetah) + - id: ruff + args: ["--fix"] diff --git a/pyproject.toml b/pyproject.toml index 16f987ec0..6b24aff4c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -60,7 +60,7 @@ doc = [ "sphinx_bootstrap_theme", ] dev = [ - "flake8", + "ruff", "isort >= 5.11.5", ] hg = [ @@ -91,6 +91,16 @@ namespaces = false [tool.pytest.ini_options] addopts = "-p no:logging" +[tool.ruff] +line-length = 99 +extend-ignore = [ + "E741", # Do not use variables named 'I', 'O', or 'l' +] +extend-exclude = [ + "asv/extern", + "test/example_results/cheetah", +] + [tool.isort] line_length = 99 only_sections = true From 4bc01e8d83aa5a44bd1a8fcc00f411b2dbeaa4c3 Mon Sep 17 00:00:00 2001 From: Zach Burnett Date: Thu, 20 Apr 2023 09:03:13 -0400 Subject: [PATCH 2/2] apply review comment suggestion --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 6b24aff4c..6ed6c3905 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -97,7 +97,6 @@ extend-ignore = [ "E741", # Do not use variables named 'I', 'O', or 'l' ] extend-exclude = [ - "asv/extern", "test/example_results/cheetah", ]