Sync errorprone configurations (#6418)
* Sync errorprone configurations * Fix
This commit is contained in:
parent
d1e46556b9
commit
f41dee250a
|
@ -23,15 +23,9 @@ tasks {
|
||||||
disableWarningsInGeneratedCode.set(true)
|
disableWarningsInGeneratedCode.set(true)
|
||||||
allDisabledChecksAsWarnings.set(true)
|
allDisabledChecksAsWarnings.set(true)
|
||||||
|
|
||||||
|
// Ignore warnings for generated and vendored classes
|
||||||
excludedPaths.set(".*/build/generated/.*|.*/concurrentlinkedhashmap/.*")
|
excludedPaths.set(".*/build/generated/.*|.*/concurrentlinkedhashmap/.*")
|
||||||
|
|
||||||
// Still Java 8
|
|
||||||
disable("Varifier")
|
|
||||||
|
|
||||||
// We often override a method returning Iterable which this makes tedious
|
|
||||||
// for questionable value.
|
|
||||||
disable("PreferredInterfaceType")
|
|
||||||
|
|
||||||
// it's very convenient to debug stuff in the javaagent using System.out.println
|
// it's very convenient to debug stuff in the javaagent using System.out.println
|
||||||
// and we don't want to conditionally only check this in CI
|
// and we don't want to conditionally only check this in CI
|
||||||
// because then the remote gradle cache won't work for local builds
|
// because then the remote gradle cache won't work for local builds
|
||||||
|
@ -40,38 +34,60 @@ tasks {
|
||||||
|
|
||||||
disable("BooleanParameter")
|
disable("BooleanParameter")
|
||||||
|
|
||||||
|
// We often override a method returning Iterable which this makes tedious
|
||||||
|
// for questionable value.
|
||||||
|
disable("PreferredInterfaceType")
|
||||||
|
|
||||||
// Doesn't work well with Java 8
|
// Doesn't work well with Java 8
|
||||||
disable("FutureReturnValueIgnored")
|
disable("FutureReturnValueIgnored")
|
||||||
|
|
||||||
// Require Guava
|
// Still Java 8
|
||||||
|
disable("Varifier")
|
||||||
|
|
||||||
|
// Doesn't currently use Var annotations.
|
||||||
|
disable("Var") // "-Xep:Var:OFF"
|
||||||
|
|
||||||
|
// ImmutableRefactoring suggests using com.google.errorprone.annotations.Immutable,
|
||||||
|
// but currently uses javax.annotation.concurrent.Immutable
|
||||||
|
disable("ImmutableRefactoring")
|
||||||
|
|
||||||
|
// AutoValueImmutableFields suggests returning Guava types from API methods
|
||||||
disable("AutoValueImmutableFields")
|
disable("AutoValueImmutableFields")
|
||||||
disable("StringSplitter")
|
// Suggests using Guava types for fields but we don't use Guava
|
||||||
disable("ImmutableMemberCollection")
|
disable("ImmutableMemberCollection")
|
||||||
|
|
||||||
// Fully qualified names may be necessary when deprecating a class to avoid
|
// Fully qualified names may be necessary when deprecating a class to avoid
|
||||||
// deprecation warning.
|
// deprecation warning.
|
||||||
disable("UnnecessarilyFullyQualified")
|
disable("UnnecessarilyFullyQualified")
|
||||||
|
|
||||||
// Don't currently use this (to indicate a local variable that's mutated) but could
|
// TODO (trask) use animal sniffer
|
||||||
// consider for future.
|
|
||||||
disable("Var")
|
|
||||||
|
|
||||||
// We use animal sniffer
|
|
||||||
disable("AndroidJdkLibsChecker")
|
|
||||||
disable("Java7ApiChecker")
|
disable("Java7ApiChecker")
|
||||||
disable("Java8ApiChecker")
|
disable("Java8ApiChecker")
|
||||||
|
disable("AndroidJdkLibsChecker")
|
||||||
|
|
||||||
// Prevents defensive null checks and we have nullaway anyways
|
// apparently disabling android doesn't disable this
|
||||||
|
disable("StaticOrDefaultInterfaceMethod")
|
||||||
|
|
||||||
|
// We don't depend on Guava so use normal splitting
|
||||||
|
disable("StringSplitter")
|
||||||
|
|
||||||
|
// Prevents lazy initialization
|
||||||
|
disable("InitializeInline")
|
||||||
|
|
||||||
|
// Seems to trigger even when a deprecated method isn't called anywhere.
|
||||||
|
// We don't get much benefit from it anyways.
|
||||||
|
disable("InlineMeSuggester")
|
||||||
|
|
||||||
|
disable("DoNotCallSuggester")
|
||||||
|
|
||||||
|
// We have nullaway so don't need errorprone nullable checks which have more false positives.
|
||||||
|
disable("FieldMissingNullable")
|
||||||
disable("ParameterMissingNullable")
|
disable("ParameterMissingNullable")
|
||||||
|
disable("ReturnMissingNullable")
|
||||||
// javax.annotation.Nullable doesn't support type parameter assertions
|
|
||||||
disable("VoidMissingNullable")
|
disable("VoidMissingNullable")
|
||||||
|
|
||||||
// Overlaps with nullaway
|
// allow UPPERCASE type parameter names
|
||||||
disable("FieldMissingNullable")
|
disable("TypeParameterNaming")
|
||||||
disable("ReturnMissingNullable")
|
|
||||||
|
|
||||||
disable("StaticOrDefaultInterfaceMethod")
|
|
||||||
|
|
||||||
// Great check, but for bytecode manipulation it's too common to separate over
|
// Great check, but for bytecode manipulation it's too common to separate over
|
||||||
// onEnter / onExit
|
// onEnter / onExit
|
||||||
|
@ -97,13 +113,9 @@ tasks {
|
||||||
// TODO(anuraaga): Remove this, probably after instrumenter API migration instead of dealing
|
// TODO(anuraaga): Remove this, probably after instrumenter API migration instead of dealing
|
||||||
// with older APIs.
|
// with older APIs.
|
||||||
disable("InconsistentOverloads")
|
disable("InconsistentOverloads")
|
||||||
disable("TypeParameterNaming")
|
|
||||||
|
|
||||||
// We don't use tools that recognize.
|
|
||||||
disable("InlineMeSuggester")
|
|
||||||
disable("DoNotCallSuggester")
|
|
||||||
|
|
||||||
if (name.contains("Jmh") || name.contains("Test")) {
|
if (name.contains("Jmh") || name.contains("Test")) {
|
||||||
|
// Allow underscore in test-type method names
|
||||||
disable("MemberName")
|
disable("MemberName")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue