Skip to content

Check Jinja Template Comments in the Prose Gate #4307

Closed

Description

@ptr727

Problem

The prose/comment-style gate reads a Jinja template, such as a .html.j2 file, as plain text, and its scope line names it as a file with "no lexer". So it never checks the comments inside {# ... #} against the comment rules. Those rules are one sentence per line, sentences of 25 words or fewer, and no wrapped sentence.

HomeAutomation-Config met this on 2026-11-19. Its fleet-report templates carried comments with wrapped, over-long sentences. The commit hook passed them, and a PR-hosted review found them later. A constructed example of the shape:

{# The page draws each repository's lists in a section of its own, and a reader opens
   only the one they need, which keeps a fleet of twenty repositories short. #}

Proposal

Teach the gate a lexer for Jinja templates, so that {# ... #} comment blocks are read as comments under the same rules as other comments. The template's markup and code stay out of scope, as they are for any other lexer.

Done when

  • A .j2 file's {# ... #} comment with two sentences on one line, or a sentence over 25 words, is a violation at the commit hook and in CI.
  • Markup and expressions in the template raise nothing.

Activity

  1. ptr727 commented on Nov 20, 2026

    @ptr727
    OwnerAuthor

    Backlog burndown claim (2026-11-20 attended run, round 2, group 4): branch burndown/prose-gate-jinja.

    Issues: #4307.

    Predicted file set:

    • .github/actions/prose-gate/prose_lint.py
    • .github/actions/prose-gate/prose-gate.json
    • tests/test_prose_lint.py

    Generated from those: none.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions