diff --git a/.github/actions/prose-gate/prose_lint.py b/.github/actions/prose-gate/prose_lint.py index 2c87eb20a..ae4d23351 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):)" ) @@ -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:)" ) diff --git a/tests/test_prose_lint.py b/tests/test_prose_lint.py index 9f97db1d0..4f1b4f357 100755 --- a/tests/test_prose_lint.py +++ b/tests/test_prose_lint.py @@ -1592,6 +1592,8 @@ 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"), + ("tool.py", "# nopep8\n"), ("app.ts", "// cspell:ignore vendorid\n"), ("app.ts", "// CSPELL: ignore vendorid\n"), ("app.ts", "// spell-checker: disable\n"),