dweiss commented on PR #14804:
URL: https://github.com/apache/lucene/pull/14804#issuecomment-2983757840
Error prone has a rule for this, actually -
```
diff --git
a/build-tools/build-infra/src/main/groovy/lucene.validation.error-prone.gradle
b/build-tools/build-infra/src/main/groovy/lucene.validation.error-prone.gradle
index 49a4a067af6..1070346a19f 100644
---
a/build-tools/build-infra/src/main/groovy/lucene.validation.error-prone.gradle
+++
b/build-tools/build-infra/src/main/groovy/lucene.validation.error-prone.gradle
@@ -331,6 +331,7 @@ allprojects { prj ->
'-Xep:UnsafeWildcard:ERROR',
'-Xep:UnusedAnonymousClass:ERROR',
'-Xep:UnusedCollectionModifiedInPlace:ERROR',
+ "-Xep:WildcardImport:ERROR",
'-Xep:VarTypeName:ERROR',
// '-Xep:WrongOneof:OFF', // we don't use protobuf
'-Xep:XorPower:ERROR',
```
I know we only run it on a CI but ast-grep requires an external tool, so
maybe it's a simpler/ better alternative? This is what the output looks like:
```
> Task :lucene:core:compileJava
/home/dweiss/mounts/ocean/work/apache/lucene/lucene/core/src/java/org/apache/lucene/internal/hppc/IntIntHashMap.java:20:
error: [WildcardImport] Wildcard imports, static or otherwise, should not be
used
import static org.apache.lucene.internal.hppc.HashContainers.*;
^
(see
https://google.github.io/styleguide/javaguide.html?cl=head#s3.3.1-wildcard-imports)
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]