How to get bug patterns supported by a given Error Prone version?
I'm looking for a way to get the exact list of bug pattern names supported by a given Error Prone version, whether experimental or not. Practically, each time we upgrade our Bazel version, there's a chance that the shipped Error Prone plugin comes with changes we'd like to leverage. Ideally, I'd like to run a Bazel command that would print such a list I could then post-process to alter our configuration accordingly. But any other semi-automatable method would do the job. Thanks in advance!
Not sure if that's what you're looking for (or maybe you found a way already) but the com.google.errorprone.scanner.BuiltInCheckerSuppliers class has ENABLED_WARNINGS and ENABLED_ERRORS sets, you can use them to programmatically get the patterns
Not sure if that's what you're looking for (or maybe you found a way already) but the
com.google.errorprone.scanner.BuiltInCheckerSuppliersclass hasENABLED_WARNINGSandENABLED_ERRORSsets, you can use them to programmatically get the patterns
Excuse me, If we customizsed some checkers, do we have to insert ours checkers into ENABLED_WARNINGS and ENABLED_ERRORS sets,?
My comment was for the built-in checkers, I don't think you would need to add your custom checkers in there.
From memory the checkers are loaded using the Java service api. See for instance https://github.com/KengoTODA/errorprone-slf4j/blob/master/src/main/java/jp/skypencil/errorprone/slf4j/Slf4jIllegalPassedClass.java uses @AutoService(BugChecker.class) to generate the service file.