diff --git a/pyproject.toml b/pyproject.toml index 9b457a7b8..019f9b395 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -86,3 +86,32 @@ indent = 4 include_trailing_comma = true lines_after_imports = 2 known_first_party = "skmatter" + +[tool.ruff] +exclude = ["docs/src/examples/"] +lint.ignore = [ + "F401", + "E203", + "D100", + "D101", + "D102", + "D205", + "D400", + "D401", +] +line-length = 88 +lint.select = [ + "D", + "E", + "F", + "W", +] + +[tool.ruff.lint.pydocstyle] +convention = "numpy" + +[tool.ruff.lint.per-file-ignores] +"examples/**" = [ + "D205", + "D400", +] diff --git a/src/skmatter/decomposition/_kernel_pcovr.py b/src/skmatter/decomposition/_kernel_pcovr.py index a76c63e28..520e542ae 100644 --- a/src/skmatter/decomposition/_kernel_pcovr.py +++ b/src/skmatter/decomposition/_kernel_pcovr.py @@ -465,6 +465,7 @@ def score(self, X, Y): independent (predictor) variable Y : numpy.ndarray dependent (response) variable + Returns ------- L : float diff --git a/tox.ini b/tox.ini index dee237d9a..52bdd9dbc 100644 --- a/tox.ini +++ b/tox.ini @@ -55,14 +55,11 @@ skip_install = true deps = black blackdoc - flake8 - flake8-bugbear - flake8-docstrings - flake8-sphinx-links + ruff isort sphinx-lint commands = - flake8 {[tox]lint_folders} + ruff check {[tox]lint_folders} black --check --diff {[tox]lint_folders} blackdoc --check --diff {[tox]lint_folders} isort --check-only --diff {[tox]lint_folders} @@ -75,10 +72,12 @@ commands = # formatting on all files skip_install = true deps = + ruff black blackdoc isort commands = + ruff check --fix {[tox]lint_folders} black {[tox]lint_folders} blackdoc {[tox]lint_folders} isort {[tox]lint_folders} @@ -92,21 +91,3 @@ extras = examples commands = sphinx-build {posargs:-E} -W -b doctest docs/src docs/build/doctest sphinx-build {posargs:-E} -W -b html docs/src docs/build/html - -[flake8] -max_line_length = 88 -exclude = - docs/src/examples/ -docstring-convention = numpy -per-file-ignores = - # D205 and D400 are incompatible with the requirements of sphinx-gallery - examples/**:D205, D400 -ignore = - E203 - D100 - D101 - D102 - D205 - D400 - D401 - W503