Commit 64db98d
authored
fix(scripts): add FooterExcludePaths parameter to frontmatter validation (#334)
# Pull Request
## Description
Add `FooterExcludePaths` parameter to frontmatter validation, enabling
per-file exclusion from footer validation without skipping footer checks
entirely.
**Changes:**
- Add `FooterExcludePaths` parameter to `Test-SingleFileFrontmatter`
with wildcard pattern support
- Thread parameter through `Invoke-FrontmatterValidation` and
`Validate-MarkdownFrontmatter.ps1`
- Add `footer-exclude-paths` workflow input with `CHANGELOG.md` default
(comma-separated list support)
- Normalize path separators for cross-platform pattern matching (forward
slashes)
- Add 6 unit tests covering exclusion logic, non-excluded files,
wildcard patterns, and parameter threading
## Related Issue(s)
Closes #333
## Type of Change
Select all that apply:
**Code & Documentation:**
- [x] Bug fix (non-breaking change fixing an issue)
- [ ] New feature (non-breaking change adding functionality)
- [ ] Breaking change (fix or feature causing existing functionality to
change)
- [ ] Documentation update
**Infrastructure & Configuration:**
- [x] GitHub Actions workflow
- [ ] Linting configuration (markdown, PowerShell, etc.)
- [ ] Security configuration
- [ ] DevContainer configuration
- [ ] Dependency update
**AI Artifacts:**
- [ ] Reviewed contribution with `prompt-builder` agent and addressed
all feedback
- [ ] Copilot instructions (`.github/instructions/*.instructions.md`)
- [ ] Copilot prompt (`.github/prompts/*.prompt.md`)
- [ ] Copilot agent (`.github/agents/*.agent.md`)
**Other:**
- [x] Script/automation (`.ps1`, `.sh`, `.py`)
- [ ] Other (please describe):
## Testing
- **Unit tests**: 4 new tests in `FrontmatterValidation.Tests.ps1`
covering `Test-SingleFileFrontmatter` footer exclusion behavior
- **Integration tests**: 2 new tests in
`Validate-MarkdownFrontmatter.Tests.ps1` verifying parameter threading
to module
- **All tests pass**: 237 total Pester tests execute successfully
- **PSScriptAnalyzer**: Clean analysis with no issues
## Checklist
### Required Checks
- [x] Documentation is updated (if applicable)
- [x] Files follow existing naming conventions
- [x] Changes are backwards compatible (if applicable)
- [x] Tests added for new functionality (if applicable)
### Required Automated Checks
The following validation commands must pass before merging:
- [x] Markdown linting: `npm run lint:md`
- [x] Spell checking: `npm run spell-check`
- [x] Frontmatter validation: `npm run lint:frontmatter`
- [x] Link validation: `npm run lint:md-links`
- [x] PowerShell analysis: `npm run lint:ps`
## Security Considerations
- [x] This PR does not contain any sensitive or NDA information
- [x] Any new dependencies have been reviewed for security issues
- [x] Security-related scripts follow the principle of least privilege
## Additional Notes
The `FooterExcludePaths` parameter uses PowerShell's `-like` operator
for pattern matching, supporting wildcards (`*`, `?`). Path separators
are normalized to forward slashes for consistent cross-platform
behavior.
Default workflow configuration excludes `CHANGELOG.md` from footer
validation since changelog files follow their own formatting
conventions.1 parent c0e48c6 commit 64db98d
File tree
5 files changed
+165
-6
lines changed- .github/workflows
- scripts
- linting
- Modules
- tests/linting
5 files changed
+165
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
26 | 31 | | |
27 | 32 | | |
28 | 33 | | |
| |||
65 | 70 | | |
66 | 71 | | |
67 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
68 | 79 | | |
69 | 80 | | |
70 | 81 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
783 | 783 | | |
784 | 784 | | |
785 | 785 | | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
786 | 790 | | |
787 | 791 | | |
788 | 792 | | |
| |||
799 | 803 | | |
800 | 804 | | |
801 | 805 | | |
| 806 | + | |
| 807 | + | |
802 | 808 | | |
803 | 809 | | |
804 | 810 | | |
| |||
891 | 897 | | |
892 | 898 | | |
893 | 899 | | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
894 | 912 | | |
895 | | - | |
| 913 | + | |
896 | 914 | | |
897 | 915 | | |
898 | 916 | | |
| |||
924 | 942 | | |
925 | 943 | | |
926 | 944 | | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
927 | 950 | | |
928 | 951 | | |
929 | 952 | | |
| |||
937 | 960 | | |
938 | 961 | | |
939 | 962 | | |
| 963 | + | |
| 964 | + | |
940 | 965 | | |
941 | 966 | | |
942 | 967 | | |
943 | 968 | | |
944 | 969 | | |
945 | 970 | | |
946 | | - | |
| 971 | + | |
947 | 972 | | |
948 | 973 | | |
949 | 974 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
42 | 45 | | |
43 | 46 | | |
44 | 47 | | |
| |||
464 | 467 | | |
465 | 468 | | |
466 | 469 | | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
467 | 475 | | |
468 | 476 | | |
469 | 477 | | |
| |||
476 | 484 | | |
477 | 485 | | |
478 | 486 | | |
| 487 | + | |
479 | 488 | | |
480 | 489 | | |
481 | 490 | | |
| |||
550 | 559 | | |
551 | 560 | | |
552 | 561 | | |
553 | | - | |
| 562 | + | |
554 | 563 | | |
555 | 564 | | |
556 | 565 | | |
| |||
726 | 735 | | |
727 | 736 | | |
728 | 737 | | |
729 | | - | |
| 738 | + | |
730 | 739 | | |
731 | 740 | | |
732 | | - | |
| 741 | + | |
733 | 742 | | |
734 | 743 | | |
735 | | - | |
| 744 | + | |
736 | 745 | | |
737 | 746 | | |
738 | 747 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1310 | 1310 | | |
1311 | 1311 | | |
1312 | 1312 | | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
1313 | 1381 | | |
1314 | 1382 | | |
1315 | 1383 | | |
| |||
1437 | 1505 | | |
1438 | 1506 | | |
1439 | 1507 | | |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
1440 | 1531 | | |
1441 | 1532 | | |
1442 | 1533 | | |
| |||
Lines changed: 23 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1055 | 1055 | | |
1056 | 1056 | | |
1057 | 1057 | | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
1058 | 1081 | | |
1059 | 1082 | | |
1060 | 1083 | | |
| |||
0 commit comments