fix(checks): narrow three over-reaching exclusions from CD-318/319/320 - #211
Merged
Conversation
Adversarial review of the four merged fixes found three real defects.
SpellingDialect skipped an entire object property subtree whenever the
key named a CSS property, and the list included a dozen words far
commoner as ordinary domain keys. A chat message's `{ role, content }`
went completely unscanned, as did `{ content: { title: '...' } }`. Now
only the property's own string value is skipped, and the ambiguous
single words — `content`, `color`, `order`, `filter`, `position`,
`width` and friends — are gone from the list. Their CSS values are
`'#fff'` and `'0 auto'`, which never carried a dialect word, so listing
them bought nothing.
MaxLineLength treated JSX text as an atomic token, so a long paragraph
of prose in a component never reported while the identical sentence in
a comment two lines above did. JSX text reflows at spaces exactly like
a comment; it is no longer collected.
OrphanExport computed test-file membership for every import edge in the
project, allocating in `matches_substring` each time, even though the
`non_test` tally is unread under the default `test_imports_count =
true`. Now computed only when it will be used.
Also: a duplicate `accent` entry, and the two test cases the review
named as missing — prose under a CSS-named key, and a mixed test plus
non-test consumer under the strict reading.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019afugU2bTYCtXn6Vy9dn1v
Criterion benchmark comparison (PR head vs base branch) |
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.
Follow-up to #207, #208 and #210. An adversarial review of all four merged fixes found three real defects, all of the same shape: an exclusion added to kill a false positive that reaches further than it should.
1. SpellingDialect went blind to any object keyed by a CSS property name
visit_object_propertyreturned early for a CSS-named key, skipping the whole subtree, andCSS_PROPERTY_NAMEScontained a dozen words far commoner as ordinary domain keys than as CSS:content,color,order,filter,position,display,width,height,top/left/right/bottom.Reproduced against the built binary with
dialect = "british":Every OpenAI-shaped message array, every CMS or i18n object keyed
content:, silently left the check.Two changes: only the property's own value is skipped, and only when that value is a string literal — never the subtree. And the ambiguous single words are gone from the list. Nothing is lost by dropping them: a
colorvalue is'#fff', anordervalue is2; neither has ever carried a dialect word. What remains is the hyphenated surface (background-color,transition-timing-function) plus the unambiguous roots, which is whatstyle={{ … }}actually needs.2. MaxLineLength silenced JSX prose
visit_jsx_textpushed the wholeJSXTextspan as an atomic token. But JSX text is exactly what Prettier reflows at spaces:The rule #210 shipped says comments split on whitespace so long prose still reports. JSX text is the same thing and now gets the same treatment.
3. OrphanExport allocated once per import edge for a discarded value
from_test_filewas computed for every incoming edge, andmatches_substringallocates via.replace('\', "/")unconditionally. Under the defaulttest_imports_count = truethenon_testtally is never read, so on a large repo that is one heap allocation per edge for nothing. Now gated on the tally being wanted.Also
"accent"entry inCSS_CLASS_HYPHEN_SEGMENTS.test_imports_count = false.Not changed
Per-path
optionsoverrides still do not reach plugin checks — filed as CD-326, and a wire-protocol question rather than a bug in #209.Verification
cargo test --workspace1410 passed / 8 ignored,cargo clippy --workspace --all-targets -- -D warnings,cargo fmt --all -- --check,cofferdam gen-docs— all green.Re-validated on real repos (
--no-cache --no-baseline, limit 120,dialect = "british"): bestefforttools MaxLineLength 16 and SpellingDialect 85, poker-puzzle 7 and 5, personal-blog 5 and 54.🤖 Generated with Claude Code
https://claude.ai/code/session_019afugU2bTYCtXn6Vy9dn1v