-
Notifications
You must be signed in to change notification settings - Fork 125
Closed
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
Summary
The Validate-MarkdownFrontmatter.ps1 script should accept (YYYY-MM-dd) as a valid token for the ms.date field in template files, in addition to actual ISO 8601 dates.
Problem
Template files (e.g., ADR templates, documentation templates) use placeholder tokens like (YYYY-MM-dd) in the frontmatter to indicate where actual dates should be inserted when the template is used. Currently, the validation script only accepts dates matching the pattern ^\d{4}-\d{2}-\d{2}$, causing warnings for template files.
Current behavior:
Invalid date format in: docs/templates/adr-template-solutions.md. Expected YYYY-MM-DD (ISO 8601), got: (YYYY-MM-dd)
Proposed Solution
Update the date validation logic in Validate-MarkdownFrontmatter.ps1 to:
- Accept
(YYYY-MM-dd)as a valid placeholder token for template files - Optionally detect template files by path pattern (e.g.,
**/templates/**) or filename pattern (e.g.,*-template*.md)
Suggested Implementation
Modify the date validation regex from:
if ($date -notmatch '^\d{4}-\d{2}-\d{2}$') {To also accept the placeholder pattern:
if ($date -notmatch '^(\d{4}-\d{2}-\d{2}|\(YYYY-MM-dd\))$') {Files Affected
scripts/linting/Validate-MarkdownFrontmatter.ps1- Lines 482-485 and 572-577
Acceptance Criteria
-
(YYYY-MM-dd)is accepted as a valid date token - Actual ISO 8601 dates (
2025-12-05) continue to work - Template files in
**/templates/**directories pass validation - No breaking changes to existing validation behavior
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers