Recognize YAML front matter and exclude it from prose checks - #27
Merged
Merged
Conversation
Adds detection of a leading YAML front matter block (the convention used by Jekyll, Hugo, and Pandoc): a document's literal first line of '---', closed by a later '---' or '...'. Content between the delimiters is skipped entirely rather than treated as prose, so metadata such as titles, author names, and keywords is never checked against STE100 rules. The opening delimiter must be the document's literal first line, so a '---' line elsewhere in the document (for example, a horizontal rule) is never misidentified as front matter. A first line of '---' with no closing delimiter anywhere in the document falls back to being treated as ordinary paragraph content, matching the same Jekyll/Hugo/Pandoc convention for that edge case. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The implementation, tests, and supporting documentation are complete; the remaining traceability nit is minor.
Review effort: Lite
Findings: None
What changed in this PR
Adds YAML front matter detection to exclude metadata from Markdown prose linting while preserving source line numbers.
Changes:
- Implements
---/...front matter detection and safe fallback behavior. - Adds extractor and linter tests.
- Updates design, verification, and requirements documentation.
| File | Summary |
|---|---|
test/DemaConsulting.Ste100Mark.Tests/Linting/MarkdownProseExtractorTests.cs |
Tests front matter extraction and edge cases. |
test/DemaConsulting.Ste100Mark.Tests/Linting/LinterTests.cs |
Verifies metadata is excluded from lint findings. |
src/DemaConsulting.Ste100Mark/Linting/MarkdownProseExtractor.cs |
Implements front matter detection and skipping. |
docs/verification/ste100-mark/linting.md |
Documents verification coverage. |
docs/reqstream/ste100-mark/linting.yaml |
Adds front matter requirement traceability. |
docs/reqstream/ste100-mark.yaml |
Links the requirement to system linting. |
docs/design/ste100-mark/linting/markdown-prose-extractor.md |
Documents extractor behavior and design. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Description
Adds detection of a leading YAML front matter block - the convention used by Jekyll, Hugo, and
Pandoc - and excludes it entirely from prose checks. A document's literal first line of
---,closed by a later
---or..., marks the block; everything between the delimiters is skippedrather than checked as prose.
Front matter holds document metadata (titles, author names, keywords), not technical prose.
Checking it as prose previously produced false-positive findings against placeholder names and
keywords, and could suggest nonsensical "corrections" to metadata values.
The opening delimiter must be the document's literal first line, so a
---line appearingelsewhere (for example, a horizontal rule) is never misidentified as front matter. A first line
of
---with no closing delimiter anywhere in the document falls back to being treated asordinary paragraph content, matching the same Jekyll/Hugo/Pandoc convention for that edge case,
rather than silently discarding the rest of the document.
Type of Change
Related Issues
Closes #
Pre-Submission Checklist
Build and Test
pwsh ./build.ps1- 1344/1344 passedCode Quality
Quality Checks
pwsh ./lint.ps1- cleanTesting
Documentation
Ste100Mark-Linting-FrontMatter, linked fromSte100Mark-System-LintAdditional Notes
Scoped to detection/exclusion only; this does not add a config flag to disable the behavior,
since front matter simply is not prose, matching how the tools that popularized this convention
(Jekyll, Hugo, Pandoc) treat it unconditionally.