Repository navigation
fix(config): the schema allows naming the class or property of MissingDependency and four other issues - #14649
Conversation
…gDependency and four other issues vimeo#4929 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Behaviour change
|
✅ Performance: unchanged · Types: unchanged
How to read this table
head 254a137 · base b5ea40d (merge-base) · workflow run |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
orklah
left a comment
There was a problem hiding this comment.
Thanks! Aligning the schema with the issue classes and locking it with a test is the right direction. Two things before this can go in:
-
MissingDependencystill can't be suppressed the way #4929 asks. The issue'sClassIssuesubject is the class that depends on the missing one ($fq_class_nameinClassLikeAnalyzer::checkFullyQualifiedClassLikeName()), not the missing dependency. With this branch:class Layer extends Not\Currently\Installed {} function f(): void { new Layer(); }
<MissingDependency> <errorLevel type="suppress"> <referencedClass name="Not\Currently\Installed" /> </errorLevel> </MissingDependency>
still reports
MissingDependency: Layer depends on class or interface not\currently\installed that does not exist, plusUnusedIssueHandlerSuppression. Only<referencedClass name="Layer" />works, which doesn't help a BC layer where many classes depend on the same absent class. Since the schema rejected<referencedClass>here until now, no existing config relies on the subject, so passing$dependency_class_nameas the issue's class would make the issue's config work. Please add a test that analyses a file like the one above and asserts the issue is suppressed by the dependency's name (the current test only callsgetReportingLevelForClass()with a name it picks itself). -
UnusedBaselineEntrycan't use<referencedClass>. It's never instantiated:IssueBuffer::finish()builds itsIssueDatadirectly, with no class and without going throughConfig::getReportingLevelFor*(), so the filter would be accepted and never apply. Please keep it asIssueHandlerTypeand exclude it explicitly intestTheSchemaAllowsNamingWhatAnIssueIsAbout.
The red CI jobs (Config.php:1360, DocumentationTest::testShortcodesAreUnique, the code style warnings) come from master at the time of the run, not from this PR; the next push will re-run them.
…dBaselineEntry takes no class filter vimeo#4929 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
<referencedClass>can't be used in the issue handler ofMissingDependency(and ofClassMustBeFinal,ReservedWord,UnusedBaselineEntry;<referencedProperty>ofInvalidPropertyAssignmentValue): the config schema rejects it, although Psalm narrows these issues to the class or property named.Before
After
Fixes #4929