summaryrefslogtreecommitdiffstats
path: root/pyproject.toml
diff options
context:
space:
mode:
authorThomas Waldmann <tw@waldmann-edv.de>2023-09-04 22:15:42 +0200
committerThomas Waldmann <tw@waldmann-edv.de>2023-09-04 22:15:42 +0200
commit98796a2f0d8e5d816dcc5d710ae3a9d5229f5c8d (patch)
tree28f1a1e5b34939e4b137f7bd5e2ecfdfa9f1a09e /pyproject.toml
parent1fd8b52f6b10557f0681fc9a4235294cefc0b4b3 (diff)
replace flake8 by ruff
Diffstat (limited to 'pyproject.toml')
-rw-r--r--pyproject.toml55
1 files changed, 55 insertions, 0 deletions
diff --git a/pyproject.toml b/pyproject.toml
index eced33233..6912a82e7 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -12,3 +12,58 @@ write_to_template = "__version__ = version = {version!r}\n"
[tool.black]
line-length = 120
skip-magic-trailing-comma = true
+
+[tool.ruff]
+line-length = 120
+target-version = "py39"
+
+# Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default.
+select = ["E", "F"]
+
+# for reference ...
+# E402 module level import not at top
+# E501 line too long
+# F401 import unused
+# F405 undefined or defined from star imports
+# F811 redef of unused var
+
+# borg code style guidelines:
+# Ignoring E203 due to https://github.com/PyCQA/pycodestyle/issues/373
+ignore = ["E203", "F405", "E402"]
+
+# Allow autofix for all enabled rules (when `--fix`) is provided.
+fixable = ["A", "B", "C", "D", "E", "F", "G", "I", "N", "Q", "S", "T", "W", "ANN", "ARG", "BLE", "COM", "DJ", "DTZ", "EM", "ERA", "EXE", "FBT", "ICN", "INP", "ISC", "NPY", "PD", "PGH", "PIE", "PL", "PT", "PTH", "PYI", "RET", "RSE", "RUF", "SIM", "SLF", "TCH", "TID", "TRY", "UP", "YTT"]
+unfixable = []
+
+# Exclude a variety of commonly ignored directories.
+exclude = [
+ ".cache",
+ ".eggs",
+ ".git",
+ ".git-rewrite",
+ ".idea",
+ ".mypy_cache",
+ ".ruff_cache",
+ ".tox",
+ "build",
+ "dist",
+]
+
+# Allow unused variables when underscore-prefixed.
+dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
+
+# Code style violation exceptions:
+# please note that the values are adjusted so that they do not cause failures
+# with existing code. if you want to change them, you should first fix all
+# ruff failures that appear with your change.
+[tool.ruff.per-file-ignores]
+"setup_docs.py" = ["E501"]
+"src/borg/archive.py" = ["E501"]
+"src/borg/archiver/help_cmd.py" = ["E501"]
+"src/borg/cache.py" = ["E501"]
+"src/borg/helpers/__init__.py" = ["F401"]
+"src/borg/platform/__init__.py" = ["F401"]
+"src/borg/testsuite/archiver/disk_full.py" = ["F811"]
+"src/borg/testsuite/archiver/return_codes.py" = ["F811"]
+"src/borg/testsuite/benchmark.py" = ["F811"]
+"src/borg/testsuite/platform.py" = ["F811"]