From 81b3690e103d4a6db5bbc1cfce04f10e6c1a7d5c Mon Sep 17 00:00:00 2001 From: esavary Date: Thu, 21 Mar 2024 15:29:51 +0100 Subject: [PATCH] CI: replace flake8 by ruff check --- .github/workflows/contrib.yml | 4 +-- pyproject.toml | 56 ++++++++++++++++++++++++++++------- 2 files changed, 48 insertions(+), 12 deletions(-) diff --git a/.github/workflows/contrib.yml b/.github/workflows/contrib.yml index c0f1a005..1438300e 100755 --- a/.github/workflows/contrib.yml +++ b/.github/workflows/contrib.yml @@ -7,7 +7,7 @@ defaults: jobs: stable: - name: Run flake8 + name: Run ruff runs-on: ubuntu-latest steps: @@ -20,4 +20,4 @@ jobs: with: python-version: 3 - name: Lint EddyMotion - run: pipx run flake8-pyproject + run: pipx run ruff check diff --git a/pyproject.toml b/pyproject.toml index 317a96e9..ce11e6cd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -136,18 +136,54 @@ exclude = ''' profile = 'black' skip_gitignore = true -[tool.flake8] -max-line-length = 99 -doctests = false -exclude = ["*build/", "docs/"] -select = "C,E,F,W,B,B950" -ignore = "N802,N806,W503,E203" -per-file-ignores = [ - "*/__init__.py: F401", - "docs/conf.py: E265", - "/^\\s*\\.\\. _.*?: http/: E501" +[tool.ruff] +line-length = 99 + +[tool.ruff.lint] +extend-select = [ + "F", + "E", + "W", + "I", + "UP", + "YTT", + "S", + "BLE", + "B", + "A", + # "CPY", + "C4", + "DTZ", + "T10", + # "EM", + "EXE", + "FA", + "ISC", + "ICN", + "PT", + "Q", +] +ignore = [ + "S311", # We are not using random for cryptographic purposes + "ISC001", + "S603", ] +[tool.ruff.lint.flake8-quotes] +inline-quotes = "single" + +[tool.ruff.lint.extend-per-file-ignores] +"*/test_*.py" = ["S101"] +"docs/source/conf.py" = ["A001"] +"mriqc/bin/nib_hash.py" = ["S324"] +"mriqc/config.py" = ["S105"] +"mriqc/conftest.py" = ["PT004"] +"mriqc/engine/plugin.py" = ["BLE001"] +"mriqc/utils/debug.py" = ["A002", "T100"] + +[tool.ruff.format] +quote-style = "single" + [tool.pytest.ini_options] pythonpath = "src/ test/" norecursedirs = [".*", "_*"]