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
[android] Check AppCompatActivity classes with CallSuperFirst and CallSuperLast rules #171
Conversation
Thanks for your contribution. This seems great at first sight. I'll add to my review backlog. |
Just one comment though, the rule would work just fine as is with To help in setting up the auxclasspath properly, I suggest you use / take a look at this gradle plugin |
@jsotuyod thanks for the reply. I'll take a look at the plugin. |
I'm on two minds regarding this. We could merge this and even add the case for I am certain we need to be much more verbose regarding this, maybe even go as far as including missing classes on reports to help people figure out what is missing exactly, just as FindBugs does, although that may produce some misleading messages with generics (we would need to asses / improve that), but even if so, it would still be better than the current situation where people can't even tell there is something amiss in their setup. Both the maven plugin and Gradle configure auxclasspath properly out of the box. Android Gradle projects (en even Java ones running old Gradle versions) can use my gradle plugin to have it working and properly configured out of the box. Maybe it's time to just push for it. What do you think @adangel ? |
@jsotuyod Regarding auxclasspath - I think, this is the direction, we should be heading towards: Making a properly configured auxclasspath a requirement for using rules which need typeresolution. At the moment these rules are still executed, but most types are |
@adangel I'd not implement it this way. Such a fail fast approach would produce a harder to fix scenario such as "hey, you missed junit", "now you are missing apache commons", "hey, do you know where is guava?". I'd personally favor a single failure with all missing classes. I'm in for disabling type resolution rules when auxclasspath is not configured, though we may consider a hard fail on such scenarios (misconfigured). I believe right now most people are falling into this scenario rather than missing classes. Finally, we certainly need to improve the documentation on the type resolution rules. We don't even mention auxclasspath right now https://pmd.github.io/pmd-5.5.2/pmd-java/rules/index.html#Type_Resolution Finally killing the type resolution ruleset would be awesome As is, I'd probably reject this PR, and create some tasks to address these 3 points on their owm (documentation, missing auxclasspath with typeresolution, missing classes). I'd suggest the changes being impacted on 5.6.0 only aince they would be breaking changes. |
Thanks for the discussion. I close the PR. |
@maksim-m thank you for bringing this up! It was certainly a useful discussion, and I'll be working to address these items. I hope the Gradle plugin I pointed to you has helped. |
Check AppCompatActivity classes (activities that use the support library) with CallSuperFirst and CallSuperLast rules