You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by GitBox <gi...@apache.org> on 2022/11/30 15:18:24 UTC

[GitHub] [solr] risdenk commented on a diff in pull request #1200: Invert error-prone configuration to be allow-list vs deny-list

risdenk commented on code in PR #1200:
URL: https://github.com/apache/solr/pull/1200#discussion_r1036103805


##########
gradle/validation/error-prone.gradle:
##########
@@ -62,53 +62,421 @@ allprojects { prj ->
 
         options.errorprone.disableWarningsInGeneratedCode = true
         options.errorprone.errorproneArgs = [
-            // bug patterns related to our tests
-            '-Xep:ExtendingJUnitAssert:OFF', // we inherit from LuceneTestCase which extends Assert
-            '-Xep:UseCorrectAssertInTests:OFF', // and this is a consequence of the above
-            '-Xep:CatchFail:OFF', // our code is generally descriptive enough, fix case by case if tests fail
-            '-Xep:JUnit4TestNotRun:OFF', // RandomizedRunner finds unannotated test methods no problem
-            '-Xep:StaticAssignmentInConstructor:OFF', // we assign SolrTestCaseJ4.configString in many tests, difficult to untangle
+            '-XepDisableAllChecks', // only enable specific checks
+            '-XepAllErrorsAsWarnings', // warnings still fail build by default, but allows usage of -Pjavac.failOnWarnings=false
+
+            // List of enabled/disabled checks
+            // Please keep this synced with https://errorprone.info/bugpatterns when upgrading!
+
+            // On by Default : ERROR
+
+            '-Xep:AlwaysThrows:ERROR',
+            '-Xep:AndroidInjectionBeforeSuper:ERROR',
+            '-Xep:ArrayEquals:ERROR',
+            '-Xep:ArrayFillIncompatibleType:ERROR',
+            '-Xep:ArrayHashCode:ERROR',
+            '-Xep:ArrayToString:ERROR',
+            '-Xep:ArraysAsListPrimitiveArray:ERROR',
+            '-Xep:AsyncCallableReturnsNull:ERROR',
+            '-Xep:AsyncFunctionReturnsNull:ERROR',
+            '-Xep:AutoValueBuilderDefaultsInConstructor:ERROR',
+            '-Xep:AutoValueConstructorOrderChecker:ERROR',
+            '-Xep:BadAnnotationImplementation:ERROR',
+            '-Xep:BadShiftAmount:ERROR',
+            '-Xep:BanJNDI:ERROR',
+            '-Xep:BoxedPrimitiveEquality:ERROR',
+            '-Xep:BundleDeserializationCast:ERROR',
+            '-Xep:ChainingConstructorIgnoresParameter:ERROR',
+            '-Xep:CheckNotNullMultipleTimes:ERROR',
+            '-Xep:CheckReturnValue:ERROR',
+            '-Xep:CollectionToArraySafeParameter:ERROR',
             '-Xep:ComparableType:OFF', // SolrTestCaseJ4.Doc and Fld are messy

Review Comment:
   I personally liked that we were excluding these explicitly. There is a comment here https://github.com/apache/lucene/pull/11971#issuecomment-1326008327 that `XepDisableAllChecks` doesn't actually disable all the checks. So I figured it was safer to explicitly disable the checks we don't want?



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org