From 05d54c857511795806262026f17bb4b5b114a515 Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Tue, 24 Dec 2024 10:14:18 +0000 Subject: [PATCH 1/8] Remove duplicated ruff configuration --- pyproject.toml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index aa3600e5..90290dc5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -132,11 +132,6 @@ lint.ignore = [ "S101", ] -lint.per-file-ignores."tests/*.py" = [ - # Do not require tests to have a one-line summary. - "D205", -] - # Do not automatically remove commented out code. # We comment out code during development, and with VSCode auto-save, this code # is sometimes annoyingly removed. From d6d66a410b074f927df04f90ed8962c788648683 Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Tue, 24 Dec 2024 10:14:48 +0000 Subject: [PATCH 2/8] Remove unnecessary ruff ignore --- pyproject.toml | 2 -- 1 file changed, 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 90290dc5..99df439d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -114,8 +114,6 @@ lint.select = [ "ALL", ] lint.ignore = [ - # We are happy to manage our own "complexity". - "C901", # Ruff warns that this conflicts with the formatter. "COM812", # Allow our chosen docstring line-style - no one-line summary. From 539d225043c1750e53413d048bf4df8b3132058a Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Tue, 24 Dec 2024 10:15:02 +0000 Subject: [PATCH 3/8] Remove unnecessary ruff ignore --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 99df439d..9a62370d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -120,7 +120,6 @@ lint.ignore = [ "D200", "D205", "D212", - "D415", # Ruff warns that this conflicts with the formatter. "ISC001", # Ignore "too-many-*" errors as they seem to get in the way more than From 8b5a6897701bf5ec402e415b27609f5d7199dad9 Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Tue, 24 Dec 2024 10:15:48 +0000 Subject: [PATCH 4/8] Remove unnecessary ruff ignore --- pyproject.toml | 2 -- 1 file changed, 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 9a62370d..5f5c1db8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -120,8 +120,6 @@ lint.ignore = [ "D200", "D205", "D212", - # Ruff warns that this conflicts with the formatter. - "ISC001", # Ignore "too-many-*" errors as they seem to get in the way more than # helping. "PLR0913", From b4f25c8dacdbe762958d1c67b6c7fe3d58d2d4a1 Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Tue, 24 Dec 2024 10:18:47 +0000 Subject: [PATCH 5/8] Only allow assert in tests --- docs/source/conf.py | 6 +++++- pyproject.toml | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index da1b8193..99ef1ff1 100755 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -46,7 +46,11 @@ requires_python = project_metadata["Requires-Python"] specifiers = SpecifierSet(specifiers=requires_python) (specifier,) = specifiers -assert specifier.operator == ">=" +if specifier.operator != ">=": + msg = ( + f"We only support '>=' for Requires-Python, got {specifier.operator}." + ) + raise ValueError(msg) minimum_python_version = specifier.version language = "en" diff --git a/pyproject.toml b/pyproject.toml index 5f5c1db8..ae5990b2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -123,7 +123,10 @@ lint.ignore = [ # Ignore "too-many-*" errors as they seem to get in the way more than # helping. "PLR0913", - # Allow 'assert' as we use it for tests. +] + +lint.per-file-ignores."tests/*.py" = [ + # Do not require tests to have a one-line summary. "S101", ] From 4e1d021c82a6adf8dc8887687a5e7bf5a935f2f1 Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Tue, 24 Dec 2024 10:20:05 +0000 Subject: [PATCH 6/8] Put back conflict ignore --- pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index ae5990b2..75c51e73 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -120,6 +120,8 @@ lint.ignore = [ "D200", "D205", "D212", + # Ruff warns that this conflicts with the formatter. + "ISC001", # Ignore "too-many-*" errors as they seem to get in the way more than # helping. "PLR0913", From 16bc9a915c058a8bb4a2c83ca96e553f11fd7d4d Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Tue, 24 Dec 2024 10:35:15 +0000 Subject: [PATCH 7/8] Allow asserts in docs --- pyproject.toml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 75c51e73..cb6b2568 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -127,8 +127,13 @@ lint.ignore = [ "PLR0913", ] +lint.per-file-ignores."docs/source/*.py" = [ + # Allow asserts in docs. + "S101", +] + lint.per-file-ignores."tests/*.py" = [ - # Do not require tests to have a one-line summary. + # Allow asserts in tests. "S101", ] From 21318569f938c843a1058a6dfd18ef4ff9bb97bd Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Tue, 24 Dec 2024 11:56:53 +0000 Subject: [PATCH 8/8] Allow asserts in README --- pyproject.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index cb6b2568..161471da 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -127,6 +127,11 @@ lint.ignore = [ "PLR0913", ] +lint.per-file-ignores."doccmd_*.py" = [ + # Allow asserts in docs. + "S101", +] + lint.per-file-ignores."docs/source/*.py" = [ # Allow asserts in docs. "S101",