feat(core): configurable --ignore screen-name globs - #5
Merged
Conversation
…/WIP frames) Wire up the previously-declared-but-unused AnalyzerOptions.ignorePatterns: user-supplied screen-name globs that exclude matching screens from the ENTIRE scan — issues, metrics, and the score. Applied in scanner.ts after collection, so a pattern like "* — Dev" removes that screen from every check (orphan, contrast, emphasis, ...), not just one. No hardcoded Dev/Demo/[FIX] list — the user decides per file. - filters.ts: globToRegExp (only * is a wildcard; everything else literal, case-insensitive, full-match) + matchesIgnore. - CLI: --ignore "<comma,separated,globs>"; MCP: ignore: string[]. Verified on EDET: --ignore "* — Dev,* — Demo" drops 16 variant screens to 0, real screens untouched. 90 tests (+2), tsc strict clean across core/cli/mcp. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… test, docs) Addresses the adversarial audit of PR #5: - filters.ts: matchesIgnore returns false for empty names, so screen-name globs (even "*") never suppress file-level diagnostics (metadata findings). - mcp: filter(Boolean) on the ignore array (drop empty strings, CLI parity). - scanner.test.ts: cover ignore filtering of additionalIssues/additionalMetrics (simulator/vision path) + the empty-name guard (the audit's only HIGH: a test-coverage gap — the filtering code was already correct). - README: document --ignore + the science flags (--metrics/--score/--ergonomics) that were missing from the Options section. 91 tests passing, tsc --noEmit strict clean across core/cli/mcp. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements
ignorePatterns(was declared inAnalyzerOptionsbut never wired): user-supplied screen-name globs that exclude matching screens from the entire scan — issues, science metrics, and the 0-100 score. Resolves the dogfood finding that variant/WIP frames (— Dev,— Demo,[FIX]) were being scored as real screens — without hardcoding a skip list (the founder chose the configurable route, zero risk of excluding real screens).How it works
filters.ts:globToRegExp(only*is a wildcard; everything else literal, case-insensitive, full-match) +matchesIgnore.scanner.ts: filters metrics (before scoring/dual-emit) and issues (before summary) by the patterns — so a pattern removes the screen from every check, not just one.--ignore "* — Dev,* — Demo,[FIX]*"; MCP:ignore: string[].Verification
Real EDET run: without ignore, 16
— Dev/— Demoscreens were flagged; with--ignore "* — Dev,* — Demo"→ 0, real screens untouched, score stable. 90 tests (+2: end-to-end ignore + glob unit),tsc --noEmitstrict clean across core/cli/mcp.Note
Not republished to npm yet — this is a backward-compatible additive feature (would be a 0.2.1/0.3.0 release when you decide to publish).
🤖 Generated with Claude Code