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
Summary
The
Validate-MarkdownFrontmatter.ps1script should accept(YYYY-MM-dd)as a valid token for thems.datefield 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:
Proposed Solution
Update the date validation logic in
Validate-MarkdownFrontmatter.ps1to:(YYYY-MM-dd)as a valid placeholder token for template files**/templates/**) or filename pattern (e.g.,*-template*.md)Suggested Implementation
Modify the date validation regex from:
To also accept the placeholder pattern:
Files Affected
scripts/linting/Validate-MarkdownFrontmatter.ps1- Lines 482-485 and 572-577Acceptance Criteria
(YYYY-MM-dd)is accepted as a valid date token2025-12-05) continue to work**/templates/**directories pass validation