2020-09-07 17:42:48 -04:00
|
|
|
/*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed with
|
|
|
|
* this work for additional information regarding copyright ownership.
|
|
|
|
* The ASF licenses this file to You under the Apache License, Version 2.0
|
|
|
|
* (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2021-03-26 16:42:15 -04:00
|
|
|
def skipReason
|
|
|
|
|
2022-01-07 13:19:46 -05:00
|
|
|
if (rootProject.usesAltJvm && rootProject.runtimeJavaVersion > JavaVersion.VERSION_15) {
|
|
|
|
skipReason = "won't work with JDK ${rootProject.runtimeJavaVersion} if used as alternative java toolchain"
|
2021-03-26 16:42:15 -04:00
|
|
|
}
|
|
|
|
|
2022-05-14 14:49:50 -04:00
|
|
|
if (!propertyOrDefault("validation.errorprone", isCIBuild).asBoolean()) {
|
|
|
|
skipReason = "skipped on builds not running inside CI environments, pass -Pvalidation.errorprone=true to enable"
|
2021-03-26 16:42:15 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
if (skipReason) {
|
2021-03-15 05:19:27 -04:00
|
|
|
configure(rootProject) {
|
|
|
|
task errorProneSkipped() {
|
|
|
|
doFirst {
|
2021-03-26 16:42:15 -04:00
|
|
|
logger.warn("WARNING: errorprone disabled (${skipReason})")
|
2021-03-15 05:19:27 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-12-28 17:20:52 -05:00
|
|
|
}
|
|
|
|
|
2020-09-07 17:42:48 -04:00
|
|
|
allprojects { prj ->
|
|
|
|
plugins.withType(JavaPlugin) {
|
2022-01-07 13:19:46 -05:00
|
|
|
// LUCENE-9650: Errorprone on master/gradle does not work with JDK-16+ when running as plugin
|
|
|
|
// inside a forked Javac process. Javac running inside Gradle works, because we have
|
|
|
|
// additional module system opens in place.
|
|
|
|
// This is a hack to keep the dependency (so that palantir's version check doesn't complain)
|
2021-03-15 05:19:27 -04:00
|
|
|
// but don't include the plugin (which fails on JDK16+).
|
2021-03-26 16:42:15 -04:00
|
|
|
if (skipReason) {
|
2021-03-15 05:19:27 -04:00
|
|
|
tasks.withType(JavaCompile) { task -> task.dependsOn ":errorProneSkipped" }
|
|
|
|
configurations {
|
|
|
|
errorprone
|
|
|
|
}
|
|
|
|
dependencies {
|
|
|
|
errorprone("com.google.errorprone:error_prone_core")
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
prj.apply plugin: 'net.ltgt.errorprone'
|
2020-09-07 17:42:48 -04:00
|
|
|
|
2021-03-15 05:19:27 -04:00
|
|
|
dependencies {
|
|
|
|
errorprone("com.google.errorprone:error_prone_core")
|
|
|
|
}
|
2020-09-07 17:42:48 -04:00
|
|
|
|
2021-03-11 16:27:25 -05:00
|
|
|
tasks.withType(JavaCompile) { task ->
|
2022-10-02 14:41:46 -04:00
|
|
|
// Disable errorprone on the MR-JAR tasks
|
|
|
|
if (task.name ==~ /compileMain\d+Java/) {
|
2022-09-26 09:22:04 -04:00
|
|
|
options.errorprone.enabled = false
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-04-10 14:35:45 -04:00
|
|
|
task.dependsOn ":checkJdkInternalsExportedToGradle"
|
|
|
|
|
2021-03-11 16:27:25 -05:00
|
|
|
options.errorprone.disableWarningsInGeneratedCode = true
|
|
|
|
options.errorprone.errorproneArgs = [
|
2022-11-23 14:53:27 -05:00
|
|
|
'-XepDisableAllChecks', // only enable specific checks
|
2022-11-15 06:42:41 -05:00
|
|
|
'-XepAllErrorsAsWarnings', // warnings still fail build by default, but allows usage of -Pjavac.failOnWarnings=false
|
2022-01-07 13:19:46 -05:00
|
|
|
|
2022-11-23 14:53:27 -05:00
|
|
|
// List of enabled/disabled checks
|
|
|
|
// Please keep this synced with https://errorprone.info/bugpatterns when upgrading!
|
2022-12-01 08:46:23 -05:00
|
|
|
// Do *NOT* enable checks based on their name or description. Read the source code and make sure they are useful!
|
|
|
|
// Most error-prone checks are not useful for non-google software.
|
2022-11-23 14:53:27 -05:00
|
|
|
|
|
|
|
// On by Default : ERROR
|
|
|
|
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:AlwaysThrows:OFF', // we don't use google collections
|
|
|
|
// '-Xep:AndroidInjectionBeforeSuper:OFF', // we don't use android
|
2022-11-25 11:46:48 -05:00
|
|
|
'-Xep:ArrayEquals:ERROR',
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:ArrayFillIncompatibleType:ERROR',
|
2022-11-25 11:47:04 -05:00
|
|
|
'-Xep:ArrayHashCode:ERROR',
|
|
|
|
'-Xep:ArrayToString:ERROR',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:ArraysAsListPrimitiveArray:OFF', // we don't use guava
|
|
|
|
// '-Xep:AsyncCallableReturnsNull:OFF', // we don't use guava
|
|
|
|
// '-Xep:AsyncFunctionReturnsNull:OFF', // we don't use guava
|
|
|
|
// '-Xep:AutoValueBuilderDefaultsInConstructor:OFF', // we don't use autovalue
|
|
|
|
// '-Xep:AutoValueConstructorOrderChecker:OFF', // we don't use autovalue
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:BadAnnotationImplementation:ERROR',
|
2022-11-25 11:47:25 -05:00
|
|
|
'-Xep:BadShiftAmount:ERROR',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:BanJNDI:OFF', // implemented with forbidden APIs instead
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:BoxedPrimitiveEquality:ERROR',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:BundleDeserializationCast:OFF', // we don't use android
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:ChainingConstructorIgnoresParameter:ERROR',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:CheckNotNullMultipleTimes:OFF', // we don't use guava
|
|
|
|
// '-Xep:CheckReturnValue:OFF', // we don't use these annotations
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:CollectionToArraySafeParameter:ERROR',
|
|
|
|
// '-Xep:ComparableType:OFF',
|
|
|
|
'-Xep:ComparingThisWithNull:ERROR',
|
|
|
|
'-Xep:ComparisonOutOfRange:ERROR',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:CompatibleWithAnnotationMisuse:OFF', // we don't use this annotation
|
|
|
|
// '-Xep:CompileTimeConstant:OFF', // we don't use this annotation
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:ComputeIfAbsentAmbiguousReference:ERROR',
|
|
|
|
'-Xep:ConditionalExpressionNumericPromotion:ERROR',
|
|
|
|
'-Xep:ConstantOverflow:ERROR',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:DaggerProvidesNull:OFF', // we don't use dagger
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:DangerousLiteralNull:ERROR',
|
|
|
|
'-Xep:DeadException:ERROR',
|
|
|
|
'-Xep:DeadThread:ERROR',
|
|
|
|
'-Xep:DiscardedPostfixExpression:ERROR',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:DoNotCall:OFF', // we don't use this annotation
|
|
|
|
// '-Xep:DoNotMock:OFF', // we don't use mocking libraries
|
|
|
|
// '-Xep:DoubleBraceInitialization:OFF', // we don't use guava
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:DuplicateMapKeys:ERROR',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:DurationFrom:OFF', // we don't use Duration.from()
|
|
|
|
// '-Xep:DurationGetTemporalUnit:OFF', // we don't use Duration.get()
|
|
|
|
// '-Xep:DurationTemporalUnit:OFF', // we don't use Duration.of() etc
|
|
|
|
// '-Xep:DurationToLongTimeUnit:OFF', // we don't use TimeUnit.convert Duration, etc
|
|
|
|
// '-Xep:EmptyTopLevelDeclaration:OFF', // noisy
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:EqualsHashCode:ERROR',
|
|
|
|
'-Xep:EqualsNaN:ERROR',
|
|
|
|
'-Xep:EqualsNull:ERROR',
|
|
|
|
'-Xep:EqualsReference:ERROR',
|
|
|
|
'-Xep:EqualsWrongThing:ERROR',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:FloggerFormatString:OFF', // we don't use flogger
|
|
|
|
// '-Xep:FloggerLogVarargs:OFF', // we don't use flogger
|
|
|
|
// '-Xep:FloggerSplitLogStatement:OFF', // we don't use flogger
|
|
|
|
// '-Xep:ForOverride:OFF', // we don't use this annotation
|
2022-11-23 14:53:27 -05:00
|
|
|
// '-Xep:FormatString:OFF',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:FormatStringAnnotation:OFF', // we don't use this annotation
|
|
|
|
// '-Xep:FromTemporalAccessor:OFF', // we don't use .from(LocalDate) etc
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:FunctionalInterfaceMethodChanged:ERROR',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:FuturesGetCheckedIllegalExceptionType:OFF', // we don't use guava
|
|
|
|
// '-Xep:FuzzyEqualsShouldNotBeUsedInEqualsMethod:OFF', // we don't use guava
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:GetClassOnAnnotation:ERROR',
|
|
|
|
'-Xep:GetClassOnClass:ERROR',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:GuardedBy:OFF', // we don't use this annotation
|
|
|
|
// '-Xep:GuiceAssistedInjectScoping:OFF', // we don't use guice
|
|
|
|
// '-Xep:GuiceAssistedParameters:OFF', // we don't use guice
|
|
|
|
// '-Xep:GuiceInjectOnFinalField:OFF', // we don't use guice
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:HashtableContains:ERROR',
|
|
|
|
// '-Xep:IdentityBinaryExpression:OFF',
|
|
|
|
'-Xep:IdentityHashMapBoxing:ERROR',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:IgnoredPureGetter:OFF', // we don't use these annotations
|
|
|
|
// '-Xep:Immutable:OFF', // we don't use this annotation
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:Incomparable:ERROR',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:IncompatibleArgumentType:OFF', // we don't use this annotation
|
|
|
|
// '-Xep:IncompatibleModifiers:OFF', // we don't use this annotation
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:IndexOfChar:ERROR',
|
|
|
|
'-Xep:InexactVarargsConditional:ERROR',
|
|
|
|
// '-Xep:InfiniteRecursion:OFF',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:InjectMoreThanOneScopeAnnotationOnClass:OFF', // we don't use this annotation
|
|
|
|
// '-Xep:InjectOnMemberAndConstructor:OFF', // we don't use this annotation
|
|
|
|
// '-Xep:InlineMeValidator:OFF', // we don't use this annotation
|
|
|
|
// '-Xep:InstantTemporalUnit:OFF', // we don't use Instant apis with strange temporal units
|
|
|
|
// '-Xep:InvalidJavaTimeConstant:OFF', // we don't use impacted java.time classes (Month, etc)
|
2022-11-23 14:53:27 -05:00
|
|
|
// '-Xep:InvalidPatternSyntax:OFF',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:InvalidTimeZoneID:OFF', // we don't use getTimeZone with constant IDs except UTC/GMT
|
|
|
|
// '-Xep:InvalidZoneId:OFF', // we don't use ZoneId.of
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:IsInstanceIncompatibleType:ERROR',
|
|
|
|
'-Xep:IsInstanceOfClass:ERROR',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:IsLoggableTagLength:OFF', // we don't use android
|
|
|
|
// '-Xep:JUnit3TestNotRun:OFF', // we don't use junit3
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:JUnit4ClassAnnotationNonStatic:ERROR',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:JUnit4SetUpNotRun:OFF', // LuceneTestCase takes care
|
|
|
|
// '-Xep:JUnit4TearDownNotRun:OFF', // LuceneTestCase takes care
|
|
|
|
// '-Xep:JUnit4TestNotRun:OFF', // noisy
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:JUnit4TestsNotRunWithinEnclosed:ERROR',
|
|
|
|
'-Xep:JUnitAssertSameCheck:ERROR',
|
|
|
|
'-Xep:JUnitParameterMethodNotFound:ERROR',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:JavaxInjectOnAbstractMethod:OFF', // we don't this annotation
|
|
|
|
// '-Xep:JodaToSelf:OFF', // we don't use joda-time
|
|
|
|
// '-Xep:LiteByteStringUtf8:OFF', // we don't use protobuf
|
|
|
|
// '-Xep:LocalDateTemporalAmount:OFF', // we don't use LocalDate math
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:LockOnBoxedPrimitive:ERROR',
|
|
|
|
'-Xep:LoopConditionChecker:ERROR',
|
|
|
|
'-Xep:LossyPrimitiveCompare:ERROR',
|
|
|
|
'-Xep:MathRoundIntLong:ERROR',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:MislabeledAndroidString:OFF', // we don't use android
|
|
|
|
// '-Xep:MisplacedScopeAnnotations:OFF', // we don't use this annotation
|
|
|
|
// '-Xep:MissingSuperCall:OFF', // we don't use this annotation
|
|
|
|
// '-Xep:MissingTestCall:OFF', // we don't use guava
|
|
|
|
// '-Xep:MisusedDayOfYear:OFF', // we don't use date patterns
|
|
|
|
// '-Xep:MisusedWeekYear:OFF', // we don't use date patterns
|
|
|
|
// '-Xep:MixedDescriptors:OFF', // we don't use protobuf
|
|
|
|
// '-Xep:MockitoUsage:OFF', // we don't use mockito
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:ModifyingCollectionWithItself:ERROR',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:MoreThanOneInjectableConstructor:OFF', // we don't use this annotation
|
|
|
|
// '-Xep:MustBeClosedChecker:OFF', // we don't use this annotation
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:NCopiesOfChar:ERROR',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:NoCanIgnoreReturnValueOnClasses:OFF', // we don't use this annotation
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:NonCanonicalStaticImport:ERROR',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:NonFinalCompileTimeConstant:OFF', // we don't use this annotation
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:NonRuntimeAnnotation:ERROR',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:NullArgumentForNonNullParameter:OFF', // we don't use this annotation
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:NullTernary:ERROR',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:NullableOnContainingClass:OFF', // we don't use this annotation
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:OptionalEquality:ERROR',
|
|
|
|
'-Xep:OptionalMapUnusedValue:ERROR',
|
|
|
|
'-Xep:OptionalOfRedundantMethod:ERROR',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:OverlappingQualifierAndScopeAnnotation:OFF', // we don't use this annotation
|
|
|
|
// '-Xep:OverridesJavaxInjectableMethod:OFF', // we don't use this annotation
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:PackageInfo:ERROR',
|
|
|
|
'-Xep:ParametersButNotParameterized:ERROR',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:ParcelableCreator:OFF', // we don't use android
|
|
|
|
// '-Xep:PeriodFrom:OFF', // we don't use Period
|
|
|
|
// '-Xep:PeriodGetTemporalUnit:OFF', // we don't use Period
|
|
|
|
// '-Xep:PeriodTimeMath:OFF', // we don't use Period
|
|
|
|
// '-Xep:PreconditionsInvalidPlaceholder:OFF', // we don't use guava
|
|
|
|
// '-Xep:PrivateSecurityContractProtoAccess:OFF', // we don't use protobuf
|
|
|
|
// '-Xep:ProtoBuilderReturnValueIgnored:OFF', // we don't use protobuf
|
|
|
|
// '-Xep:ProtoFieldNullComparison:OFF', // we don't use protobuf
|
|
|
|
// '-Xep:ProtoStringFieldReferenceEquality:OFF', // we don't use protobuf
|
|
|
|
// '-Xep:ProtoTruthMixedDescriptors:OFF', // we don't use protobuf
|
|
|
|
// '-Xep:ProtocolBufferOrdinal:OFF', // we don't use protobuf
|
|
|
|
// '-Xep:ProvidesMethodOutsideOfModule:OFF', // we don't use guice
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:RandomCast:ERROR',
|
|
|
|
'-Xep:RandomModInteger:ERROR',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:RectIntersectReturnValueIgnored:OFF', // we don't use android
|
|
|
|
// '-Xep:RequiredModifiers:OFF', // we don't use this annotation
|
|
|
|
// '-Xep:RestrictedApiChecker:OFF', // we don't use this annotation
|
|
|
|
// '-Xep:ReturnValueIgnored:OFF', // noisy
|
2022-11-25 11:45:45 -05:00
|
|
|
'-Xep:SelfAssignment:ERROR',
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:SelfComparison:ERROR',
|
|
|
|
'-Xep:SelfEquals:ERROR',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:ShouldHaveEvenArgs:OFF', // we don't use truth
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:SizeGreaterThanOrEqualsZero:ERROR',
|
|
|
|
'-Xep:StreamToString:ERROR',
|
|
|
|
'-Xep:StringBuilderInitWithChar:ERROR',
|
|
|
|
'-Xep:SubstringOfZero:ERROR',
|
|
|
|
'-Xep:SuppressWarningsDeprecated:ERROR',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:TemporalAccessorGetChronoField:OFF', // we don't use TemporalAccessor.get
|
|
|
|
// '-Xep:TestParametersNotInitialized:OFF', // we don't use this annotation
|
|
|
|
// '-Xep:TheoryButNoTheories:OFF', // we don't use junit theory apis/runner
|
|
|
|
// '-Xep:ThrowIfUncheckedKnownChecked:OFF', // we don't use this annotation
|
|
|
|
// '-Xep:ThrowNull:OFF', // noisy (LuceneTestCase)
|
|
|
|
// '-Xep:TreeToString:OFF', // we don't use javac API
|
|
|
|
// '-Xep:TruthSelfEquals:OFF', // we don't use truth
|
2022-11-23 14:53:27 -05:00
|
|
|
// '-Xep:TryFailThrowable:OFF',
|
|
|
|
'-Xep:TypeParameterQualifier:ERROR',
|
|
|
|
'-Xep:UnicodeDirectionalityCharacters:ERROR',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:UnicodeInCode:OFF', // noisy (spatial3d)
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:UnnecessaryCheckNotNull:ERROR',
|
|
|
|
'-Xep:UnnecessaryTypeArgument:ERROR',
|
|
|
|
'-Xep:UnsafeWildcard:ERROR',
|
|
|
|
'-Xep:UnusedAnonymousClass:ERROR',
|
|
|
|
'-Xep:UnusedCollectionModifiedInPlace:ERROR',
|
|
|
|
'-Xep:VarTypeName:ERROR',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:WrongOneof:OFF', // we don't use protobuf
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:XorPower:ERROR',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:ZoneIdOfZ:OFF', // we don't use ZoneId.of
|
2022-11-23 14:53:27 -05:00
|
|
|
|
|
|
|
// On by Default : WARNING
|
|
|
|
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:AlmostJavadoc:OFF', // noisy (e.g. commented-out code misinterpreted as javadocs)
|
|
|
|
// '-Xep:AlreadyChecked:OFF', // TODO: there are problems
|
2022-11-23 14:53:27 -05:00
|
|
|
// '-Xep:AmbiguousMethodReference:OFF',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:AnnotateFormatMethod:OFF', // we don't use this annotation
|
|
|
|
// '-Xep:ArgumentSelectionDefectChecker:OFF', // noisy
|
|
|
|
// '-Xep:ArrayAsKeyOfSetOrMap:OFF', // TODO: there are problems
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:AssertEqualsArgumentOrderChecker:WARN',
|
|
|
|
'-Xep:AssertThrowsMultipleStatements:WARN',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:AssertionFailureIgnored:OFF', // TODO: there are problems
|
|
|
|
// '-Xep:AssistedInjectAndInjectOnSameConstructor:OFF', // we don't use this annotation
|
|
|
|
// '-Xep:AutoValueFinalMethods:OFF', // we don't use autovalue
|
|
|
|
// '-Xep:AutoValueImmutableFields:OFF', // we don't use autovalue
|
|
|
|
// '-Xep:AutoValueSubclassLeaked:OFF', // we don't use autovalue
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:BadComparable:WARN',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:BadImport:OFF', // TODO: there are problems
|
|
|
|
// '-Xep:BadInstanceof:OFF', // TODO: there are problems
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:BareDotMetacharacter:WARN',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:BigDecimalEquals:OFF', // BigDecimal barely used, can use forbidden-apis for this
|
|
|
|
// '-Xep:BigDecimalLiteralDouble:OFF', // BigDecimal barely used, can use forbidden-apis for this
|
2022-11-23 14:53:27 -05:00
|
|
|
// '-Xep:BoxedPrimitiveConstructor:OFF', // we have forbiddenapis for that
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:BugPatternNaming:OFF', // we don't use this annotation
|
2022-11-23 14:53:27 -05:00
|
|
|
// '-Xep:ByteBufferBackingArray:OFF',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:CacheLoaderNull:OFF', // we don't use guava
|
|
|
|
// '-Xep:CanonicalDuration:OFF', // barely use Duration.of (one test), just a style thing
|
|
|
|
// '-Xep:CatchAndPrintStackTrace:OFF', // noisy
|
|
|
|
// '-Xep:CatchFail:OFF', // TODO: there are problems
|
|
|
|
// '-Xep:ChainedAssertionLosesContext:OFF', // we don't use truth
|
|
|
|
// '-Xep:CharacterGetNumericValue:OFF', // noisy
|
|
|
|
// '-Xep:ClassCanBeStatic:OFF', // noisy
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:ClassNewInstance:WARN',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:CloseableProvides:OFF', // we don't use this annotation
|
|
|
|
// '-Xep:CollectionUndefinedEquality:OFF', // TODO: there are problems
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:CollectorShouldNotUseState:WARN',
|
|
|
|
'-Xep:ComparableAndComparator:WARN',
|
|
|
|
'-Xep:CompareToZero:WARN',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:ComplexBooleanConstant:OFF', // TODO: there are problems
|
|
|
|
// '-Xep:DateChecker:OFF', // we don't use these Date setters/ctors
|
|
|
|
// '-Xep:DateFormatConstant:OFF', // we don't use Date setters
|
|
|
|
// '-Xep:DefaultCharset:OFF', // we have forbiddenapis for that
|
2022-11-23 14:53:27 -05:00
|
|
|
// '-Xep:DefaultPackage:OFF',
|
|
|
|
'-Xep:DeprecatedVariable:WARN',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:DirectInvocationOnMock:OFF', // we don't use mocking libraries
|
|
|
|
// '-Xep:DistinctVarargsChecker:OFF', // we don't use google collections
|
|
|
|
// '-Xep:DoNotCallSuggester:OFF', // we don't use this annotation
|
|
|
|
// '-Xep:DoNotClaimAnnotations:OFF', // we don't use annotation processors
|
|
|
|
// '-Xep:DoNotMockAutoValue:OFF', // we don't use autovalue
|
|
|
|
// '-Xep:DoubleCheckedLocking:OFF', // TODO: there are problems
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:EmptyBlockTag:WARN',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:EmptyCatch:OFF', // ECJ takes care
|
|
|
|
// '-Xep:EmptySetMultibindingContributions:OFF', // we don't use this annotation
|
|
|
|
// '-Xep:EqualsGetClass:OFF', // noisy
|
2022-11-23 14:53:27 -05:00
|
|
|
// '-Xep:EqualsIncompatibleType:OFF',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:EqualsUnsafeCast:OFF', // noisy
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:EqualsUsingHashCode:WARN',
|
|
|
|
'-Xep:ErroneousBitwiseExpression:WARN',
|
|
|
|
'-Xep:ErroneousThreadPoolConstructorChecker:WARN',
|
|
|
|
// '-Xep:EscapedEntity:OFF',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:ExtendingJUnitAssert:OFF', // noisy
|
|
|
|
// '-Xep:ExtendsObject:OFF', // TODO: there are problems
|
|
|
|
// '-Xep:FallThrough:OFF', // TODO: there are problems
|
|
|
|
// '-Xep:Finally:OFF', // TODO: there are problems
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:FloatCast:WARN',
|
|
|
|
'-Xep:FloatingPointAssertionWithinEpsilon:WARN',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:FloatingPointLiteralPrecision:OFF', // TODO: there are problems
|
|
|
|
// '-Xep:FloggerArgumentToString:OFF', // we don't use flogger
|
|
|
|
// '-Xep:FloggerStringConcatenation:OFF', // we don't use flogger
|
|
|
|
// '-Xep:FragmentInjection:OFF', // we don't use android
|
|
|
|
// '-Xep:FragmentNotInstantiable:OFF', // we don't use android
|
|
|
|
// '-Xep:FutureReturnValueIgnored:OFF', // TODO: there are problems
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:GetClassOnEnum:WARN',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:HidingField:OFF', // noisy
|
|
|
|
// '-Xep:IdentityHashMapUsage:OFF', // noisy
|
|
|
|
// '-Xep:ImmutableAnnotationChecker:OFF', // we don't use this annotation
|
|
|
|
// '-Xep:ImmutableEnumChecker:OFF', // noisy
|
|
|
|
// '-Xep:InconsistentCapitalization:OFF', // TODO: there are problems
|
|
|
|
// '-Xep:InconsistentHashCode:OFF', // noisy
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:IncorrectMainMethod:WARN',
|
|
|
|
'-Xep:IncrementInForLoopAndHeader:WARN',
|
|
|
|
'-Xep:InheritDoc:WARN',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:InjectInvalidTargetingOnScopingAnnotation:OFF', // we don't use this annotation
|
|
|
|
// '-Xep:InjectOnConstructorOfAbstractClass:OFF', // we don't use this annotation
|
|
|
|
// '-Xep:InjectScopeAnnotationOnInterfaceOrAbstractClass:OFF', // we don't use this annotation
|
|
|
|
// '-Xep:InjectedConstructorAnnotations:OFF', // we don't use this annotation
|
|
|
|
// '-Xep:InlineFormatString:OFF', // noisy
|
|
|
|
// '-Xep:InlineMeInliner:OFF', // we don't use this annotation
|
|
|
|
// '-Xep:InlineMeSuggester:OFF', // we don't use this annotation
|
2022-11-23 14:53:27 -05:00
|
|
|
// '-Xep:InputStreamSlowMultibyteRead:OFF',
|
|
|
|
'-Xep:InstanceOfAndCastMatchWrongType:WARN',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:IntLongMath:OFF', // noisy
|
|
|
|
// '-Xep:InvalidBlockTag:OFF', // noisy (e.g. lucene.experimental)
|
|
|
|
// '-Xep:InvalidInlineTag:OFF', // TODO: there are problems
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:InvalidLink:WARN',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:InvalidParam:OFF', // TODO: there are problems
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:InvalidThrows:WARN',
|
|
|
|
'-Xep:InvalidThrowsLink:WARN',
|
|
|
|
'-Xep:IterableAndIterator:WARN',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:JUnit3FloatingPointComparisonWithoutDelta:OFF', // we don't use junit3
|
|
|
|
// '-Xep:JUnit4ClassUsedInJUnit3:OFF', // we don't use junit3
|
|
|
|
// '-Xep:JUnitAmbiguousTestClass:OFF', // we don't use junit3
|
|
|
|
// '-Xep:JavaDurationGetSecondsGetNano:OFF', // we don't use these Duration methods
|
|
|
|
// '-Xep:JavaDurationWithNanos:OFF', // we don't use these Duration methods
|
|
|
|
// '-Xep:JavaDurationWithSeconds:OFF', // we don't use these Duration methods
|
|
|
|
// '-Xep:JavaInstantGetSecondsGetNano:OFF', // we don't use these Instant methods
|
|
|
|
// '-Xep:JavaLangClash:OFF', // TODO: there are problems
|
|
|
|
// '-Xep:JavaLocalDateTimeGetNano:OFF', // we don't use LocalDateTime
|
|
|
|
// '-Xep:JavaLocalTimeGetNano:OFF', // we don't use LocalTime
|
|
|
|
// '-Xep:JavaPeriodGetDays:OFF', // we don't use Period
|
|
|
|
// '-Xep:JavaTimeDefaultTimeZone:OFF', // forbidden-apis checks this
|
|
|
|
// '-Xep:JavaUtilDate:OFF', // noisy
|
|
|
|
// '-Xep:JavaxInjectOnFinalField:OFF', // we don't use this annotation
|
|
|
|
// '-Xep:JdkObsolete:OFF', // noisy
|
|
|
|
// '-Xep:JodaConstructors:OFF', // we don't use joda-time
|
|
|
|
// '-Xep:JodaDateTimeConstants:OFF', // we don't use joda-time
|
|
|
|
// '-Xep:JodaDurationWithMillis:OFF', // we don't use joda-time
|
|
|
|
// '-Xep:JodaInstantWithMillis:OFF', // we don't use joda-time
|
|
|
|
// '-Xep:JodaNewPeriod:OFF', // we don't use joda-time
|
|
|
|
// '-Xep:JodaPlusMinusLong:OFF', // we don't use joda-time
|
|
|
|
// '-Xep:JodaTimeConverterManager:OFF', // we don't use joda-time
|
|
|
|
// '-Xep:JodaWithDurationAddedLong:OFF', // we don't use joda-time
|
|
|
|
// '-Xep:LiteEnumValueOf:OFF', // we don't use protobuf
|
|
|
|
// '-Xep:LiteProtoToString:OFF', // we don't use protobuf
|
|
|
|
// '-Xep:LockNotBeforeTry:OFF', // TODO: there are problems
|
2022-12-01 20:32:42 -05:00
|
|
|
'-Xep:LogicalAssignment:WARN',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:LongDoubleConversion:OFF', // TODO: there are problems
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:LongFloatConversion:WARN',
|
|
|
|
'-Xep:LoopOverCharArray:WARN',
|
|
|
|
'-Xep:MalformedInlineTag:WARN',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:MathAbsoluteRandom:OFF', // TODO: there are problems
|
|
|
|
// '-Xep:MemoizeConstantVisitorStateLookups:OFF', // we don't use this class
|
|
|
|
// '-Xep:MissingCasesInEnumSwitch:OFF', // redundant with ECJ incompleteEnumSwitch/missingEnumCaseDespiteDefault
|
|
|
|
// '-Xep:MissingFail:OFF', // TODO: there are problems
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:MissingImplementsComparable:WARN',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:MissingOverride:OFF', // ECJ takes care of this
|
|
|
|
// '-Xep:MissingSummary:OFF', // TODO: there are problems
|
|
|
|
// '-Xep:MixedMutabilityReturnType:OFF', // noisy
|
|
|
|
// '-Xep:MockNotUsedInProduction:OFF', // we don't use mocking libraries
|
|
|
|
// '-Xep:ModifiedButNotUsed:OFF', // TODO: there are problems
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:ModifyCollectionInEnhancedForLoop:WARN',
|
|
|
|
'-Xep:ModifySourceCollectionInStream:WARN',
|
|
|
|
'-Xep:MultipleParallelOrSequentialCalls:WARN',
|
|
|
|
'-Xep:MultipleUnaryOperatorsInMethodCall:WARN',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:MutablePublicArray:OFF', // TODO: there are problems
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:NarrowCalculation:WARN',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:NarrowingCompoundAssignment:OFF', // noisy
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:NegativeCharLiteral:WARN',
|
|
|
|
'-Xep:NestedInstanceOfConditions:WARN',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:NonAtomicVolatileUpdate:OFF', // TODO: there are problems
|
|
|
|
// '-Xep:NonCanonicalType:OFF', // noisy
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:NonOverridingEquals:WARN',
|
|
|
|
'-Xep:NullOptional:WARN',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:NullableConstructor:OFF', // we don't use this annotation
|
|
|
|
// '-Xep:NullablePrimitive:OFF', // we don't use this annotation
|
|
|
|
// '-Xep:NullablePrimitiveArray:OFF', // we don't use this annotation
|
|
|
|
// '-Xep:NullableVoid:OFF', // we don't use this annotation
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:ObjectEqualsForPrimitives:WARN',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:ObjectToString:OFF', // TODO: there are problems
|
|
|
|
// '-Xep:ObjectsHashCodePrimitive:OFF', // TODO: there are problems
|
|
|
|
// '-Xep:OperatorPrecedence:OFF', // noisy
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:OptionalMapToOptional:WARN',
|
|
|
|
'-Xep:OptionalNotPresent:WARN',
|
|
|
|
'-Xep:OrphanedFormatString:WARN',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:OutlineNone:OFF', // we don't use gwt
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:OverrideThrowableToString:WARN',
|
|
|
|
'-Xep:Overrides:WARN',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:OverridesGuiceInjectableMethod:OFF', // we don't use guice
|
|
|
|
// '-Xep:ParameterName:OFF', // we don't pass parameters with comments in this way
|
|
|
|
// '-Xep:PreconditionsCheckNotNullRepeated:OFF', // we don't use guava
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:PrimitiveAtomicReference:WARN',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:ProtectedMembersInFinalClass:OFF', // we don't use protobuf
|
|
|
|
// '-Xep:ProtoDurationGetSecondsGetNano:OFF', // we don't use protobuf
|
|
|
|
// '-Xep:ProtoRedundantSet:OFF', // we don't use protobuf
|
|
|
|
// '-Xep:ProtoTimestampGetSecondsGetNano:OFF', // we don't use protobuf
|
|
|
|
// '-Xep:QualifierOrScopeOnInjectMethod:OFF', // we don't use this annotation
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:ReachabilityFenceUsage:WARN',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:ReferenceEquality:OFF', // noisy
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:RethrowReflectiveOperationExceptionAsLinkageError:WARN',
|
|
|
|
'-Xep:ReturnFromVoid:WARN',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:RobolectricShadowDirectlyOn:OFF', // we don't use robolectric
|
|
|
|
// '-Xep:RxReturnValueIgnored:OFF', // we don't use rxjava
|
|
|
|
// '-Xep:SameNameButDifferent:OFF', // TODO: there are problems
|
|
|
|
// '-Xep:SelfAlwaysReturnsThis:OFF', // we don't use self() methods, this isn't python.
|
|
|
|
// '-Xep:ShortCircuitBoolean:OFF', // TODO: there are problems
|
2022-11-23 14:53:27 -05:00
|
|
|
// '-Xep:StaticAssignmentInConstructor:OFF',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:StaticAssignmentOfThrowable:OFF', // noisy
|
2022-11-23 14:53:27 -05:00
|
|
|
// '-Xep:StaticGuardedByInstance:OFF',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:StaticMockMember:OFF', // we don't use mock libraries
|
|
|
|
// '-Xep:StreamResourceLeak:OFF', // TODO: there are problems
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:StreamToIterable:WARN',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:StringSplitter:OFF', // noisy, can use forbidden-apis for this
|
|
|
|
// '-Xep:SwigMemoryLeak:OFF', // we don't use swig
|
|
|
|
// '-Xep:SynchronizeOnNonFinalField:OFF', // noisy
|
2022-11-23 14:53:27 -05:00
|
|
|
// '-Xep:ThreadJoinLoop:OFF',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:ThreadLocalUsage:OFF', // noisy
|
|
|
|
// '-Xep:ThreadPriorityCheck:OFF', // noisy, forbidden APIs can do this
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:ThreeLetterTimeZoneID:WARN',
|
|
|
|
'-Xep:TimeUnitConversionChecker:WARN',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:ToStringReturnsNull:OFF', // TODO: there are problems
|
|
|
|
// '-Xep:TruthAssertExpected:OFF', // we don't use truth
|
|
|
|
// '-Xep:TruthConstantAsserts:OFF', // we don't use truth
|
|
|
|
// '-Xep:TruthGetOrDefault:OFF', // we don't use truth
|
|
|
|
// '-Xep:TruthIncompatibleType:OFF', // we don't use truth
|
|
|
|
// '-Xep:TypeEquals:OFF', // we don't use this internal javac api
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:TypeNameShadowing:WARN',
|
|
|
|
// '-Xep:TypeParameterShadowing:OFF',
|
|
|
|
// '-Xep:TypeParameterUnusedInFormals:OFF',
|
|
|
|
'-Xep:URLEqualsHashCode:WARN',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:UndefinedEquals:OFF', // TODO: there are problems
|
|
|
|
// '-Xep:UnescapedEntity:OFF', // TODO: there are problems
|
|
|
|
// '-Xep:UnicodeEscape:OFF', // noisy
|
|
|
|
// '-Xep:UnnecessaryAssignment:OFF', // we don't use these annotations
|
|
|
|
// '-Xep:UnnecessaryLambda:OFF', // TODO: there are problems
|
|
|
|
// '-Xep:UnnecessaryLongToIntConversion:OFF', // TODO: there are problems
|
|
|
|
// '-Xep:UnnecessaryMethodInvocationMatcher:OFF', // we don't use spring
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:UnnecessaryMethodReference:WARN',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:UnnecessaryParentheses:OFF', // noisy
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:UnrecognisedJavadocTag:WARN',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:UnsafeFinalization:OFF', // we don't use finalizers, deprecated for removal, fails build
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:UnsafeReflectiveConstructionCast:WARN',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:UnsynchronizedOverridesSynchronized:OFF', // TODO: there are problems
|
|
|
|
// '-Xep:UnusedMethod:OFF', // TODO: there are problems
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:UnusedNestedClass:WARN',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:UnusedTypeParameter:OFF', // TODO: there are problems
|
|
|
|
// '-Xep:UnusedVariable:OFF', // noisy, can use ECJ
|
|
|
|
// '-Xep:UseBinds:OFF', // we don't use this annotation
|
|
|
|
// '-Xep:UseCorrectAssertInTests:OFF', // noisy
|
2022-11-23 14:53:27 -05:00
|
|
|
'-Xep:VariableNameSameAsType:WARN',
|
2022-12-01 08:46:23 -05:00
|
|
|
// '-Xep:WaitNotInLoop:OFF', // TODO: there are problems
|
|
|
|
// '-Xep:WakelockReleasedDangerously:OFF', // we don't use android
|
|
|
|
// '-Xep:WithSignatureDiscouraged:OFF', // we aren't using this error-prone internal api
|
2021-03-11 16:27:25 -05:00
|
|
|
]
|
|
|
|
}
|
2020-09-07 17:42:48 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|