From 93777092c3d562348b7f6888801bb832f9790117 Mon Sep 17 00:00:00 2001 From: "Luke W. Johnston" Date: Fri, 7 Aug 2026 10:29:01 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20=E2=9C=A8=20allow=20use=20of=20`Optiona?= =?UTF-8?q?l[]`=20in=20Ruff=20checks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/.config/ruff.toml | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/template/.config/ruff.toml b/template/.config/ruff.toml index 7c08aab..dbc7947 100644 --- a/template/.config/ruff.toml +++ b/template/.config/ruff.toml @@ -1,4 +1,4 @@ -# Support Python 3.12+ +# Support Python 3.12+. target-version = "py312" # In addition to the default formatters/linters, add these as well. @@ -10,19 +10,25 @@ extend-select = [ "D", # Add isort to list. "I", - # Check for unused arguments + # Check for unused arguments. "ARG", ] -# Ignore missing docstring at the top of files -ignore = ["D100"] +ignore = [ + # Ignore missing docstring at the top of files. + "D100", + # Use `Optional[]` typing. + "UP045", +] [lint.pydocstyle] convention = "google" -[format] -docstring-code-format = true - [lint.per-file-ignores] -# ignore "Module imported but unused" error in all init files +# Ignore "Module imported but unused" error in all init files. "__init__.py" = ["F401"] -"**/tests/*" = ["D"] +# Don't require docstrings and ignore unused arguments in test files. +# Must move up from the `.config/` directory to the root of the project. +"../**/tests/*" = ["D", "ARG"] + +[format] +docstring-code-format = true