You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A trailing noqa or pylint directive exempts the prose in front of it from every comment rule #2807
NOT_PROSE in .github/actions/prose-gate/prose_lint.py exempts a comment body carrying a trailing # noqa or # pylint: directive as a whole, so the prose in front of the directive is judged by none of comment-wrap, comment-case and comment-added.
Constructed case, drawing no finding from any of the three rules:
# A new prose comment the reviewer never sees. # noqa
On a line holding only a comment, the directive can suppress nothing but findings about the comment itself, so the reason comment-added exempts a directive, that deleting one changes what the file does, does not reach the prose. Appending a directive therefore still switches every comment rule off for that line, a narrower form of #1659.
Judging the body with the trailing directive stripped off would keep the directive exempt and the prose judged. The behavior predates the branch fixing #1659, which narrowed the trailing set to the forms flake8, ruff and pylint read without changing how much of the body it exempts. Found by a local review pass on that branch.
A wider shape of the same root, found by a local review pass on #2808: the trailing alternatives in NOT_PROSE (#\s*(?:noqa|type:\s*ignore)\b and \bpylint:) apply in every language, though only Python checkers read those forms. So a TOML, YAML, or shell comment that mentions one mid-sentence is exempt from all three comment rules.
Constructed case, drawing no finding in a.toml:
# two sentences here. Each line carries a `# noqa` marker.
The same line without the backticked mention draws comment-wrap, comment-case, and comment-added. Gating the trailing alternatives on the Python path would close this half alongside the one above.
Activity
ptr727 commentedon Oct 11, 2026
A wider shape of the same root, found by a local review pass on #2808: the trailing alternatives in
NOT_PROSE(#\s*(?:noqa|type:\s*ignore)\band\bpylint:) apply in every language, though only Python checkers read those forms. So a TOML, YAML, or shell comment that mentions one mid-sentence is exempt from all three comment rules.Constructed case, drawing no finding in
a.toml:The same line without the backticked mention draws
comment-wrap,comment-case, andcomment-added. Gating the trailing alternatives on the Python path would close this half alongside the one above.Read a Tool Name as a Prose Gate Directive Only Where It Opens the Co…
Judge the Prose in Front of a Trailing noqa or pylint Directive (#2814)