Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude manifest classes from rule ReClassesHaveNoReferencesCondition #16953

Closed
hernanmd opened this issue Jul 26, 2024 · 0 comments
Closed

Exclude manifest classes from rule ReClassesHaveNoReferencesCondition #16953

hernanmd opened this issue Jul 26, 2024 · 0 comments
Assignees

Comments

@hernanmd
Copy link
Member

Bug description
It seems we have a problem with the rule ignoring classes not referenced, specifically the method: ruleClassNotReferencedRuleV1FalsePositive. When you mark a class reference as false positive, for instance, MyClassNonEmptyLeafUnused, that method is populated with an entry and we get something like this:

ruleClassNotReferencedRuleV1FalsePositive

	<ignoreForCoverage>
	^ #(#(#(#RGClassDefinition #(#RBHierarchySubclassBForClassVariable)) #'2024-07-18T12:39:47.723158+02:00') #(#(#RGClassDefinition #(#MyClassNonEmptyLeafUnused)) #'2024-07-18T12:40:19.70241+02:00') #(#(#RGClassDefinition #(#RBDummyCompositeLintRuleTest)) #'2024-07-18T12:40:19.702201+02:00') #(#(#RGClassDefinition #(#RBClassUsingSharedPoolForTestData)) #'2024-07-18T12:40:19.701335+02:00') #(#(#RGClassDefinition #(#RBBasicDummyLintRuleTest)) #'2024-07-18T12:40:19.702472+02:00') #(#(#RGClassDefinition #(#RBTransformationRuleTestData2)) #'2024-07-18T12:40:19.701755+02:00') )

We could remove, of course, the introduced class ManifestRefactoringDataForTesting. But we would get back all the same errors we were getting without the Manifest.

What I will do is update the ReClassesHaveNoReferencesCondition>>violators method to discard those classes that are manifest. That would require implementing isManifest in RB-related classes.

To Reproduce
See PR #16917

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: DONE
Development

No branches or pull requests

2 participants