dotmd-cli 0.8.1 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/validate.mjs +6 -3
package/package.json
CHANGED
package/src/validate.mjs
CHANGED
|
@@ -13,15 +13,18 @@ export function validateDoc(doc, frontmatter, headingTitle, config) {
|
|
|
13
13
|
doc.warnings.push({ path: doc.path, level: 'warning', message: `Unknown status \`${doc.status}\`; not in statuses.order.` });
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
// Only enforce lifecycle fields for known statuses (skip for unknown like implemented, partial, etc.)
|
|
17
|
+
const knownStatus = config.validStatuses.has(doc.status);
|
|
18
|
+
|
|
19
|
+
if (knownStatus && !config.lifecycle.skipWarningsFor.has(doc.status) && !doc.updated) {
|
|
17
20
|
doc.errors.push({ path: doc.path, level: 'error', message: 'Missing frontmatter `updated` for non-archived doc.' });
|
|
18
21
|
}
|
|
19
22
|
|
|
20
|
-
if (doc.auditLevel && doc.auditLevel !== 'none' && !doc.audited) {
|
|
23
|
+
if (knownStatus && doc.auditLevel && doc.auditLevel !== 'none' && !doc.audited) {
|
|
21
24
|
doc.errors.push({ path: doc.path, level: 'error', message: '`audit_level` is set without `audited`.' });
|
|
22
25
|
}
|
|
23
26
|
|
|
24
|
-
if (doc.auditLevel === 'none' && doc.audited) {
|
|
27
|
+
if (knownStatus && doc.auditLevel === 'none' && doc.audited) {
|
|
25
28
|
doc.errors.push({ path: doc.path, level: 'error', message: '`audit_level: none` cannot be combined with `audited`.' });
|
|
26
29
|
}
|
|
27
30
|
|