From ae16c668b8d355df6c394d4227773ad021216b66 Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Sun, 26 Jan 2025 19:45:15 +0100 Subject: [PATCH] Start enforcing ruff rules --- pyproject.toml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index d546d3d0..c8b1d186 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,3 +5,29 @@ requires = [ "cython" ] build-backend = "setuptools.build_meta" + +[tool.ruff] +target-version = "py38" + +[tool.ruff.lint] +extend-select = [ + "UP", # pyupgrade + "C4", # flake8-comprehensions + "PIE", # flake8-pie + "FLY", # flynt + "PERF", # Perflint + "RUF", +] +ignore = [ + "F841", # Local variable is assigned to but never used + "UP031", # Use format specifiers instead of percent format + "UP032", # Use f-string instead of `format` call + "PERF203", # `try`-`except` within a loop incurs performance overhead + "RUF003", + "RUF005", # Consider iterable unpacking instead of concatenation + "RUF012", # Mutable class attributes should be annotated with `typing.ClassVar` + "RUF100", # Unused `noqa` directive +] + +[tool.ruff.lint.extend-per-file-ignores] +"**/__init__.py" = ["F401"] # imported but unused