Hello! I have a custom rule that does something l...
# detekt
d
Hello! I have a custom rule that does something like
LibraryEntitiesShouldNotBePublic
does, but also checking inner classes and other stuff. I want to ignore this rule for entities with a specific annotation, and I found a strange case, and I'm wondering whether this is the expected behaviour or not.
🧵 1
I have this configuration for my rule
Copy code
MyRuleSet:
  MyLibraryEntitiesShouldNotBePublic:
    active: true
    ignoreAnnotated:
      - 'MyCustomAnnotation'
This code reports an issue for
class B
, indicating that it should not be public, which is what I expect from my rule.
Copy code
internal class A {
    class B
}
But this code does not report anything.
Copy code
@MyCustomAnnotation
class A {
    class B
}
Are inner classes issues supposed to be ignored when their parent class is annotated?
b
ignoreAnnotated
suppresses issues for it and any of its children
So yes, this is the expected behavior
d
OK, thank you 🙂