From 25a6d78b88edaa9cc698e03e17cd42e007ea292c Mon Sep 17 00:00:00 2001 From: Willi Ballenthin Date: Thu, 6 Jul 2023 16:32:31 +0200 Subject: [PATCH] ruff: update config --- .github/ruff.toml | 49 +++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 43 insertions(+), 6 deletions(-) diff --git a/.github/ruff.toml b/.github/ruff.toml index 2740b0e0..ea923692 100644 --- a/.github/ruff.toml +++ b/.github/ruff.toml @@ -1,10 +1,47 @@ -# Enable pycodestyle (`E`) codes -select = ["E"] +# Enable the pycodestyle (`E`) and Pyflakes (`F`) rules by default. +# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or +# McCabe complexity (`C901`) by default. +select = ["E", "F"] + +# Allow autofix for all enabled rules (when `--fix`) is provided. +fixable = ["ALL"] +unfixable = [] # E402 module level import not at top of file # E722 do not use bare 'except' -ignore = ["E402", "E722"] -exclude = ["*_pb2.py", "*_pb2.pyi"] +# E501 line too long +ignore = ["E402", "E722", "E501"] -# Same as pycodestyle. -line-length = 180 +line-length = 120 + +exclude = [ + # Exclude a variety of commonly ignored directories. + ".bzr", + ".direnv", + ".eggs", + ".git", + ".git-rewrite", + ".hg", + ".mypy_cache", + ".nox", + ".pants.d", + ".pytype", + ".ruff_cache", + ".svn", + ".tox", + ".venv", + "__pypackages__", + "_build", + "buck-out", + "build", + "dist", + "node_modules", + "venv", + # protobuf generated files + "*_pb2.py", + "*_pb2.pyi" +] + +[per-file-ignores] +#"__init__.py" = ["E402"] +#"path/to/file.py" = ["E402"]