diff options
author | Philipp Hörist <philipp@hoerist.com> | 2022-11-27 23:41:26 +0300 |
---|---|---|
committer | Philipp Hörist <philipp@hoerist.com> | 2022-11-28 01:43:04 +0300 |
commit | bf75d67255aa91aa1e161cb599ff6ed16e948e46 (patch) | |
tree | e1d5815fa442106452a9efd5a1245339edd28d04 /pyproject.toml | |
parent | b29572138be5126ec96564ea8f0350cb58cd1840 (diff) |
ci: Add ruff configuration
Diffstat (limited to 'pyproject.toml')
-rw-r--r-- | pyproject.toml | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/pyproject.toml b/pyproject.toml index 6f77d9f1a..08e6dc615 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -149,3 +149,70 @@ include = [ "gajim/plugins/plugins_i18n.py", "gajim/plugins/repository.py", ] + + +[tool.ruff] +line-length = 80 + +select = [ + "A", # flake8-builtins + # "ANN", # flake8-annotations + "B", # flake8-bugbear + "BLE", # flake8-blind-except + "C", # flake8-comprehensions + "C901", # mccabe + # "D", # pydocstyle + "E", # pycodestyle + "F", # pyflakes + "FBT", # flake8-boolean-trap + # "I", # flake8-tidy-imports, isort + "M", # Meta rules + "N", # pep8-naming + "Q", # flake8-quotes + "RUF", # Ruff-specific rules + "S", # flake8-bandit + "T", # flake8-debugger, flake8-print + "U", # pyupgrade + "W", # pycodestyle + "YTT", # flake8-2020 +] + +ignore = [ + "S101", # Use of `assert` detected + "FBT003", # Boolean positional value in function call + "BLE001", # Blind except Exception: statement +] + +exclude = [ + ".eggs", + ".git", + ".ruff_cache", + ".venv", + "build", + "dist", + "venv", + "*.pyi", + # Code Folders + "gajim/gui", + "typings", + "gajim/common/config.py", # legacy module, will be removed + "gajim/common/optparser.py", # legacy module, will be removed + "gajim/common/socks5.py", # legacy module, will be removed +] + +# Allow unused variables when underscore-prefixed. +dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" +target-version = "py39" + +[tool.ruff.per-file-ignores] +"test/*" = ["E402"] +"test/no_gui/test_styling.py" = ["RUF001"] + + +[tool.ruff.mccabe] +max-complexity = 15 + +[tool.ruff.flake8-quotes] +inline-quotes = "single" +docstring-quotes = "single" +multiline-quotes = "single" |