From 736f157f3a586c3e99c14496d49fecfb70986194 Mon Sep 17 00:00:00 2001 From: Fritz Brand Date: Tue, 8 Oct 2024 15:10:28 +0200 Subject: [PATCH] Updated ruff config with ignores --- pyproject.toml | 61 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 60 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 416feab..206ef58 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,6 +48,65 @@ build-backend = "poetry.core.masonry.api" [tool.ruff] extend-exclude = [ - "*/migrations/*.py" + "*/migrations/*.py", + "docs/conf.py", ] + +[tool.ruff.lint] +select = [ + "E", "F", "W", # pycodestyle + pyflakes == flake8 - mccabe + "I", # isort + "UP", # pyupgrade + "S", # flake8-bandit + "B", # flake8-bugbear + "C4", # flake8-comprehensions + # "DJ", # flake8-django + "PIE", # flake8-pie + # "PT", # flake8-pytest-style + "SIM", # flake8-simplify + "PTH", # flake8-use-pathlib + # "RUF", # ruff-specific rules +] +ignore = [ + "E501", # TODO: Something about these long lines. + "S113", # TODO: Request timeouts. + "UP032", # TODO: Use f strings instead of format + "B904", # TODO: Fix exceptions raised in exception handlers. + "SIM102", # It's often more convenient/readable to use nested conditionals. + "SIM118", # TODO: Apply fixes for these + "SIM300", # TODO: Fix this, we must + "PIE804", # TODO: Use keyword args instead of **dict + "SIM105", # TODO: Replace this with contextlib.suppress + "S324", # TODO: Look into a fix for this + "UP012", # TODO: Decide whether to fix or ignore + "SIM210", # TODO: Fix these with bool() + "B006", # TODO: Fix mutable default + "C408", # TODO: Replace with dict literals + "S311", # TODO: Decide whether to fix or ignore + "C416", # TODO: Fix with list() + "B007", # TODO: Replace i with _i + "PTH118", # TODO: Switch to pathlib + "UP010", # TODO: Fix unnecessary future import + +] + +[tool.ruff.lint.per-file-ignores] +"**/tests/**" = [ + "S101", # It's okay to use `assert` in tests. + "S106", # TODO: Silent these in place + +] +"**/config/settings/{test,dev}.py" = [ + "S104", # It's okay to bind to all interfaces in tests + "F405", # Its okay to import * in settings + "S105", # Its okay to have hardcoded secrets in test config + + +] +# TODO: Move this somewhere sensible? +"**/tests.py" = [ + "S101", # It's okay to use `assert` in tests. + "S106", # TODO: Silent these in place + +] \ No newline at end of file