Fix detector URL and advisory handling

Recover joined URL arguments without splitting local paths, derive advisory behavior from registry severity across consumers, inspect readable linked CSS in URL scans, and report only the dominant primary font.

AI assistance disclosure: Implemented and verified with Codex under maintainer direction.
This commit is contained in:
Paul Bakaus
2026-09-02 09:03:34 -07:00
parent a264199177
commit e4438ea586
14 changed files with 272 additions and 45 deletions
+6 -4
View File
@@ -10,7 +10,7 @@ const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
const cli = path.join(root, 'cli', 'bin', 'cli.js');
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'impeccable-stdin-dispatch-'));
function detectStdinFile(filePath) {
function detectStdinFile(filePath, expectedStatus = 2) {
const result = spawnSync(
process.execPath,
[cli, 'detect', '--json', '--no-config', '--no-design-system'],
@@ -19,7 +19,7 @@ function detectStdinFile(filePath) {
encoding: 'utf8',
},
);
assert.equal(result.status, 2, result.stderr);
assert.equal(result.status, expectedStatus, result.stderr);
return JSON.parse(result.stdout);
}
@@ -57,9 +57,11 @@ describe('detect CLI stdin file dispatch', () => {
}
`);
const findings = detectStdinFile(filePath);
const findings = detectStdinFile(filePath, 0);
assert.ok(findings.some(
(item) => item.file === filePath && item.antipattern === 'codex-grid-background',
(item) => item.file === filePath
&& item.antipattern === 'codex-grid-background'
&& item.advisory === true,
));
});
});