Reject scalar frontmatter coverage

AI assistance: Codex validated and addressed the Greptile scalar-frontmatter review finding with regression coverage.
This commit is contained in:
Paul Bakaus
2026-07-30 09:34:31 -07:00
parent 7a0489bd91
commit de9d543825
2 changed files with 24 additions and 1 deletions
+1 -1
View File
@@ -123,7 +123,7 @@ function hasCoverageValue(value) {
return Object.values(value).some(hasCoverageValue);
}
if (typeof value === 'string') return value.trim().length > 0;
return value !== null && value !== undefined;
return false;
}
export function checkDesignCoverage({ design, designPath, parseDesignMd }) {
+23
View File
@@ -216,6 +216,29 @@ describe('checkDesignCoverage', () => {
assert.doesNotMatch(findings[0].summary, /typography|components/);
});
it('does not count boolean or numeric frontmatter scalars as section coverage', () => {
for (const colors of ['false', '0']) {
const design = [
'---',
'name: X',
`colors: ${colors}`,
'typography:',
' body:',
' fontFamily: Inter',
'components:',
' button:',
' backgroundColor: "#111111"',
'---',
'',
'# Design System: X',
'',
].join('\n');
const findings = checkDesignCoverage({ design, designPath: 'DESIGN.md', parseDesignMd });
assert.deepEqual(ids(findings), ['design-md-coverage']);
assert.match(findings[0].summary, /no colors section/);
}
});
it('reports nothing without a DESIGN.md', () => {
assert.deepEqual(checkDesignCoverage({ design: null, parseDesignMd }), []);
});