mdsmith
Esc
    v0.52.0 GitHub
    MDS057 prose ready

    MDS057: required-text-patterns

    Heading-bounded sections must match every configured regex.

    The rule walks every heading in the document. For each heading the rule joins the plain text of paragraphs in the section’s line range. The range runs from the heading down to the next heading at the same or shallower level, including nested sub-sections.

    Each configured regex is tested against the joined text. Patterns that do not match emit one diagnostic at the section’s heading line. Under a schema scope override , the per-scope filter keeps only diagnostics inside the scope’s range.

    skip-indices exempts named child indices when the rule runs from a scope override on a section with children:. The setting parses but has no effect today; it activates once the children: schema feature lands.

    # Settings

    SettingTypeDefaultDescription
    patternslist[]List of {pattern, message, skip-indices} entries. pattern must be a valid Go regular expression; others optional.

    # Config

    Document-wide:

    rules:
      required-text-patterns:
        patterns:
          - pattern: "scope: production"
            message: "every section must declare scope"

    Per-section (via schema scope):

    kinds:
      runbook:
        schema:
          sections:
            - heading: "Diagnosis"
              rules:
                required-text-patterns:
                  patterns:
                    - pattern: "forward reference"
                      skip-indices: [-1]

    Disable:

    rules:
      required-text-patterns: false

    # Examples

    # Good

    # Title
    
    This section meets the expectation: forward reference.

    # Bad

    # Title
    
    This section is missing the required token.

    # Meta-Information

    • ID: MDS057
    • Name: required-text-patterns
    • Status: ready
    • Default: disabled
    • Fixable: no
    • Implementation: source
    • Category: prose