From 47a22f9587f94fa5bc2705302a3e29dca3701dcf Mon Sep 17 00:00:00 2001 From: Alexander Hess Date: Thu, 3 Dec 2026 11:47:26 +0100 Subject: [PATCH] Put the `ruff` per-file ignores on separate lines Each reason now sits next to its codes, which reads better than a separate list. --- pyproject.toml | 42 ++++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 23469bb..2a975ed 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -728,13 +728,19 @@ external = [ [tool.ruff.lint.per-file-ignores] -# Type annotations are not strictly enforced -"migrations/env.py" = ["ANN0", "ANN2"] -# - ANN0, ANN2 => Type annotations are not strictly enforced -# - S608 => Do not worry about SQL injection here -"migrations/versions/*.py" = ["ANN0", "ANN2", "S608"] -# Type annotations are not strictly enforced -"noxfile.py" = ["ANN0", "ANN2"] +"migrations/env.py" = [ + "ANN0", "ANN2", # Type annotations are not strictly enforced +] + +"migrations/versions/*.py" = [ + "ANN0", "ANN2", # Type annotations are not strictly enforced + "S608", # Do not worry about SQL injection here +] + +"noxfile.py" = [ + "ANN0", "ANN2", # Type annotations are not strictly enforced +] + "research/*.ipynb" = [ "ANN0", "ANN2", # Type annotations are not strictly enforced "E501", # Exploratory cells read better unwrapped @@ -744,15 +750,19 @@ external = [ "S605", "S608", # No untrusted input "T20", # `print()` shows results ] -# `print()` is ok in ad-hoc scripts -"scripts/**" = ["T20"] -# - ANN0, ANN2 => Type annotations are not strictly enforced -# - D106 => The `Meta` class inside the factory_boy models do not need a docstring -# - PLR0913, PLR0917 => `pytest` passes fixtures as arguments -# - S101 => `assert` statements are ok in the test suite -# - S311 => The `random` module is not used for cryptography -# - SLF001 => Tests may set up and inspect private members -"tests/**/*.py" = ["ANN0", "ANN2", "D106", "PLR0913", "PLR0917", "S101", "S311", "SLF001"] + +"scripts/**" = [ + "T20", # `print()` is ok in ad-hoc scripts +] + +"tests/**/*.py" = [ + "ANN0", "ANN2", # Type annotations are not strictly enforced + "D106", # The `Meta` class inside the factory_boy models do not need a docstring + "PLR0913", "PLR0917", # `pytest` passes fixtures as arguments + "S101", # `assert` statements are ok in the test suite + "S311", # The `random` module is not used for cryptography + "SLF001", # Tests may set up and inspect private members +] [tool.ruff.lint.flake8-pytest-style] # aligned with [tool.flake8] above