Lint frontmatter
Check the frontmatter block of every named Markdown file against the key list the user supplies, and report each violation with its file and line.
Steps
- When the user names a directory, list its Markdown files with
Glob; otherwise check exactly the files named. - Read each file's frontmatter — the block between the opening
---and the next---. When a file has no frontmatter block, report the file rather than inventing an empty block, because a fabricated block hides the real defect. - Compare the block's keys against the user's key list: report a missing required key, an empty value, and a key outside the list, each with file and line.
- Report one table covering all files. When every file passes, say so and list the files checked.