From 26be7940e17960d593b0dc4da0a452a2f9394c21 Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Sun, 31 Dec 2023 13:16:08 +0100 Subject: [PATCH] build: Replace flake8 with ruff Add isort (I) rules to the default set of ruff rules, as a replacement for flake8-import-order. --- .flake8 | 4 ---- .github/workflows/ci.yaml | 4 ++-- .ruff.toml | 5 +++++ CONTRIBUTING.rst | 2 +- pyproject.toml | 3 +-- 5 files changed, 9 insertions(+), 9 deletions(-) delete mode 100644 .flake8 create mode 100644 .ruff.toml diff --git a/.flake8 b/.flake8 deleted file mode 100644 index 2b7958b..0000000 --- a/.flake8 +++ /dev/null @@ -1,4 +0,0 @@ -[flake8] -import-order-style = pep8 -application-import-names = yamllint -ignore = W503,W504 diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 780831e..506d610 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -21,9 +21,9 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 - run: - pip install flake8 flake8-import-order sphinx rstcheck[sphinx] doc8 + pip install ruff sphinx rstcheck[sphinx] doc8 - run: pip install . - - run: flake8 . + - run: ruff . - run: doc8 $(git ls-files '*.rst') - run: rstcheck --ignore-directives automodule $(git ls-files '*.rst') - run: yamllint --strict $(git ls-files '*.yaml' '*.yml') diff --git a/.ruff.toml b/.ruff.toml new file mode 100644 index 0000000..943ec04 --- /dev/null +++ b/.ruff.toml @@ -0,0 +1,5 @@ +[lint] +extend-select = ["I"] + +[lint.isort] +known-third-party = ["tests"] diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 312c6d8..a1fde07 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -23,7 +23,7 @@ Pull Request Process .. code:: bash - flake8 . + ruff . If you added/modified documentation: diff --git a/pyproject.toml b/pyproject.toml index 63746f6..5fd24df 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,9 +26,8 @@ dynamic = ["version"] [project.optional-dependencies] dev = [ "doc8", - "flake8", - "flake8-import-order", "rstcheck[sphinx]", + "ruff", "sphinx", ]