From 3a40ee21557cb8e8ad9010b042b7b759d6cee8dd Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Sun, 11 Oct 2026 11:15:54 -0700 Subject: [PATCH 1/3] Exempt nopep8 as a Leading Directive in the Prose Gate NOT_PROSE named noqa but not nopep8, so a leading nopep8 directive line holding two sentences was judged by comment-wrap and comment-case. Co-Authored-By: Claude Opus 5.5 --- .github/actions/prose-gate/prose_lint.py | 2 +- tests/test_prose_lint.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/actions/prose-gate/prose_lint.py b/.github/actions/prose-gate/prose_lint.py index 2c87eb20a..96cdb9afb 100755 --- a/.github/actions/prose-gate/prose_lint.py +++ b/.github/actions/prose-gate/prose_lint.py @@ -1568,7 +1568,7 @@ def resume_at(carry: Carried, line: str) -> tuple[Carried, int | None]: # A tool's name is anchored at the body's start, since a comment naming one mid-sentence is prose. NOT_PROSE = re.compile( r"^(?:!|\s*[-=#*/<>]+\s*$|ruff:|mypy:|(?i:flake8)[:=]|v\d+(?:\.\d+)*$" - r"|(?:(?i:noqa)|type:\s*ignore|pylint|shellcheck|markdownlint|omit from toc|prettier|eslint" + r"|(?:(?i:noqa|nopep8)|type:\s*ignore|pylint|shellcheck|markdownlint|omit from toc|prettier|eslint" r"|SPDX|Copyright)\b|(?i:c?spell|spell-?checker):)" ) diff --git a/tests/test_prose_lint.py b/tests/test_prose_lint.py index 9f97db1d0..b2e885e71 100755 --- a/tests/test_prose_lint.py +++ b/tests/test_prose_lint.py @@ -1592,6 +1592,7 @@ def test_a_directive_is_read_in_any_letter_case_its_tool_reads(self) -> None: ("tool.py", "# NoQA\n"), ("tool.py", "# NOPEP8\n"), ("tool.py", "# NoPep8: E501\n"), + ("tool.py", "# NOPEP8: E501. Another sentence follows.\n"), ("app.ts", "// cspell:ignore vendorid\n"), ("app.ts", "// CSPELL: ignore vendorid\n"), ("app.ts", "// spell-checker: disable\n"), From 1ad556dbe535ec53a3a007afca3a8e260ef56886 Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Sun, 11 Oct 2026 11:21:12 -0700 Subject: [PATCH 2/3] Drop the Redundant nopep8 Entry From the Tool Directive Pattern NOT_PROSE now exempts nopep8 from every comment rule, as it does noqa, so the TOOL_DIRECTIVE entry could never be reached. Co-Authored-By: Claude Opus 5.5 --- .github/actions/prose-gate/prose_lint.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/prose-gate/prose_lint.py b/.github/actions/prose-gate/prose_lint.py index 96cdb9afb..ae4d23351 100755 --- a/.github/actions/prose-gate/prose_lint.py +++ b/.github/actions/prose-gate/prose_lint.py @@ -1671,7 +1671,7 @@ def resume_at(carry: Carried, line: str) -> tuple[Carried, int | None]: # So a name here is exempt from that one rule, and a name in `NOT_PROSE` from all three. TOOL_DIRECTIVE = re.compile( r"^(?:syntax=|escape=|fmt:\s*(?:on|off|skip)\b|pragma:|nosec\b|checkov:|hadolint\b" - r"|renovate:|yaml-language-server:|-\*-\s*coding[:=]|pyright:|isort:|(?i:nopep8)\b" + r"|renovate:|yaml-language-server:|-\*-\s*coding[:=]|pyright:|isort:" r"|codespell:|doctest:)" ) From f5d03225040e13bf54c62ac99de433a36aef07ef Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Sun, 11 Oct 2026 11:29:16 -0700 Subject: [PATCH 3/3] Pin the Lowercase nopep8 Spelling in the Directive Case Test Co-Authored-By: Claude Opus 5.5 --- tests/test_prose_lint.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_prose_lint.py b/tests/test_prose_lint.py index b2e885e71..4f1b4f357 100755 --- a/tests/test_prose_lint.py +++ b/tests/test_prose_lint.py @@ -1593,6 +1593,7 @@ def test_a_directive_is_read_in_any_letter_case_its_tool_reads(self) -> None: ("tool.py", "# NOPEP8\n"), ("tool.py", "# NoPep8: E501\n"), ("tool.py", "# NOPEP8: E501. Another sentence follows.\n"), + ("tool.py", "# nopep8\n"), ("app.ts", "// cspell:ignore vendorid\n"), ("app.ts", "// CSPELL: ignore vendorid\n"), ("app.ts", "// spell-checker: disable\n"),