Proposal: Incorporate Error-Prone
See original GitHub issueError-Prone is a static analysis tool from Google that runs a wealth of checks during compilation, and (in my opinion) is a no brainer for most standard Java projects today.
it also supports custom checkers for internal or community checkers. One such community checks that would be useful here could be Uber’s NullAway, giving basically compile-time nullability checking in the project. Most things under the src/test validators
package could also be moved to custom error-prone checks that run during compile-time rather than tests, for faster turnaround and also eliminate the need for some annotations to be RUNTIME
retained.
Integration is fairly simple in Gradle. If this proposal sounds acceptable, I could start with a basic error-prone integration, and then followups to potentially include other checkers or migrate existing validators could happen after.
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (11 by maintainers)
Again, to satisfy this tool, you’d have to fill up the source code with suppressions, workarounds, mangled structures, etc. I accepted the nullability annotations in the public parts because that’s useful for the consumer of the library. However, messing up the internal parts to suppress false positives which wouldn’t even be there without the tool is wasteful. Remember, the reviewers have to go through all the changed locations anyway and wonder, “which rule required this change and why exactly?”
If you can filter out the noise and truly find an actual mistake, post a PR fixing that specifically without introducing the whole infrastructure. Hence I suggested using the tool only in your own local environment.
Understood