diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index c9b3aeb71a6..40b6f52c00a 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -22,13 +22,12 @@ "vscode": { "extensions": [ "guyskk.language-cython", - "ms-python.isort", "ms-toolsai.jupyter", "ms-python.vscode-pylance", - "ms-python.pylint", "ms-python.python", "lextudio.restructuredtext", - "trond-snekvik.simple-rst" + "trond-snekvik.simple-rst", + "charliermarsh.ruff" ] } } diff --git a/.vscode/extensions.json b/.vscode/extensions.json index d0efd087bc9..a304fa28467 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -2,6 +2,7 @@ // List of extensions which should be recommended for developers when a workspace is opened for the first time. // See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations. "recommendations": [ - "ms-python.python" + "ms-python.python", + "charliermarsh.ruff" ], } diff --git a/.vscode/settings.json b/.vscode/settings.json index 86885e6ea4a..86eac03ffe9 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -24,11 +24,6 @@ "--doctest-modules" ], "python.testing.unittestEnabled": false, - "python.linting.pycodestyleEnabled": true, - "python.linting.enabled": true, - // The following pycodestyle arguments are the same as the pycodestyle-minimal - // tox environnment, see the file SAGE_ROOT/src/tox.ini - "python.linting.pycodestyleArgs": ["--select= E111,E21,E222,E225,E227,E228,E25,E271,E303,E305,E306,E401,E502,E701,E702,E703,E71,E72,W291,W293,W391,W605"], "cSpell.words": [ "furo", "Conda", diff --git a/ruff.toml b/ruff.toml new file mode 100644 index 00000000000..d6dd6fed1bd --- /dev/null +++ b/ruff.toml @@ -0,0 +1,14 @@ +# https://docs.astral.sh/ruff/configuration/#config-file-discovery + +# Assume Python 3.9 +target-version = "py39" + +select = [ + "E", # pycodestyle errors - https://docs.astral.sh/ruff/rules/#error-e + "F", # pyflakes - https://docs.astral.sh/ruff/rules/#pyflakes-f + "I", # isort - https://docs.astral.sh/ruff/rules/#isort-i + "PL", # pylint - https://docs.astral.sh/ruff/rules/#pylint-pl +] +ignore = [ + "E501", # Line too long - hard to avoid in doctests, and better handled by black. +]