Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/gajim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Hörist <philipp@hoerist.com>2022-11-27 23:41:26 +0300
committerPhilipp Hörist <philipp@hoerist.com>2022-11-28 01:43:04 +0300
commitbf75d67255aa91aa1e161cb599ff6ed16e948e46 (patch)
treee1d5815fa442106452a9efd5a1245339edd28d04 /pyproject.toml
parentb29572138be5126ec96564ea8f0350cb58cd1840 (diff)
ci: Add ruff configuration
Diffstat (limited to 'pyproject.toml')
-rw-r--r--pyproject.toml67
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"