lhotari opened a new pull request #8879:
URL: https://github.com/apache/pulsar/pull/8879


   ### Motivation
   
   Google's [Error Prone static code analysis tool](https://errorprone.info/) 
can detect typical programming mistakes (for more info see 
https://errorprone.info/). This PR adds configuration to Pulsar maven build so 
that Error Prone static code analysis
   can be run for the Pulsar code base. This additional configuration is not 
active by default and requires activating `errorprone` and `errorprone-jdk8` or 
`errorprone-jdk11` maven profiles in addition to `main` or `core-modules` 
profile for running the analysis.
   
   ### Modifications
   
   - add a separate maven profile for running errorprone analysis
     it is not active by default
   
   - example usage:
     JDK8
     `mvn -Perrorprone,errorprone-jdk8,core-modules compile`
     JDK11+
     `mvn -Perrorprone,errorprone-jdk11,core-modules compile`
     - usability of Error Prone is better when used together with IntelliJ
       since one can click on the error message to navigate
       to the code location
   
   - Configure Lombok to add `@javax.annotation.Generated("lombok")` on all 
fields, methods, and types that are generated by Lombok. This is required for 
static code analysis tools like Error Prone so that they don't run checks on 
Lombok generated code.
   
   - also add configuration for Error Prone SLF4J plugin 
https://github.com/KengoTODA/errorprone-slf4j . It helps detect misusage of 
SLF4J API . Some checks are opinionated, so the configuration might need more 
customization to prevent unnecessary error reports. 
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to