| /* |
| * 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. |
| */ |
| |
| def skipReason |
| |
| if (rootProject.usesAltJvm) { |
| skipReason = "won't work with alternative java toolchain" |
| } |
| |
| if (!propertyOrDefault("validation.errorprone", isCIBuild).asBoolean()) { |
| skipReason = "skipped on builds not running inside CI environments, pass -Pvalidation.errorprone=true to enable" |
| } |
| |
| if (skipReason) { |
| configure(rootProject) { |
| task errorProneSkipped() { |
| doFirst { |
| logger.warn("WARNING: errorprone disabled (${skipReason})") |
| } |
| } |
| } |
| } |
| |
| allprojects { prj -> |
| plugins.withType(JavaPlugin) { |
| // LUCENE-9650: Errorprone does not work when running as a plugin inside a forked Javac process. |
| // Javac running inside Gradle works, because we have additional module system opens in place. |
| if (skipReason) { |
| tasks.withType(JavaCompile) { task -> task.dependsOn ":errorProneSkipped" } |
| |
| // Error prone plugin adds error prone to test classpath. We need to add it here too (manually) so that |
| // versions.lock is consistent with or without error prone. |
| configurations { |
| errorprone |
| } |
| dependencies { |
| errorprone deps.errorprone |
| } |
| configurations.annotationProcessor.extendsFrom(configurations.errorprone) |
| } else { |
| prj.apply plugin: deps.plugins.errorprone.get().pluginId |
| |
| dependencies { |
| errorprone deps.errorprone |
| } |
| |
| tasks.withType(JavaCompile) { task -> |
| // Disable errorprone on the MR-JAR tasks |
| if (task.name ==~ /compileMain\d+Java/) { |
| options.errorprone.enabled = false |
| return |
| } |
| |
| // Exclude certain files (generated ones, mostly). |
| switch (project.path) { |
| case ":lucene:core": |
| options.errorprone.excludedPaths.set(".*/StandardTokenizerImpl.java") |
| break |
| |
| case ":lucene:analysis:common": |
| options.errorprone.excludedPaths.set("" + |
| ".*/HTMLStripCharFilter.java|" + |
| ".*/UAX29URLEmailTokenizerImpl.java") |
| break |
| |
| case ":lucene:test-framework": |
| options.errorprone.excludedPaths.set("" + |
| ".*/EmojiTokenizationTestUnicode_11_0.java|" + |
| ".*/WordBreakTestUnicode_9_0_0.java") |
| break |
| |
| case ":lucene:expressions": |
| break |
| |
| case ":lucene:queryparser": |
| options.errorprone.excludedPaths.set("" + |
| ".*/classic/ParseException.java|" + |
| ".*/classic/QueryParser.java|" + |
| ".*/classic/QueryParserConstants.java|" + |
| ".*/classic/QueryParserTokenManager.java|" + |
| ".*/classic/Token.java|" + |
| ".*/classic/TokenMgrError.java|" + |
| ".*/standard/parser/ParseException.java|" + |
| ".*/standard/parser/StandardSyntaxParser.java|" + |
| ".*/standard/parser/StandardSyntaxParserConstants.java|" + |
| ".*/standard/parser/StandardSyntaxParserTokenManager.java|" + |
| ".*/standard/parser/Token.java|" + |
| ".*/standard/parser/TokenMgrError.java|" + |
| ".*/surround/parser/ParseException.java|" + |
| ".*/surround/parser/QueryParser.java|" + |
| ".*/surround/parser/QueryParserConstants.java|" + |
| ".*/surround/parser/QueryParserTokenManager.java|" + |
| ".*/surround/parser/Token.java|" + |
| ".*/surround/parser/TokenMgrError.java") |
| break |
| } |
| |
| task.dependsOn ":checkJdkInternalsExportedToGradle" |
| |
| options.errorprone.disableWarningsInGeneratedCode = true |
| options.errorprone.errorproneArgs = [ |
| '-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! |
| // 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. |
| |
| // On by Default : ERROR |
| |
| // '-Xep:AlwaysThrows:OFF', // we don't use google collections |
| // '-Xep:AndroidInjectionBeforeSuper:OFF', // we don't use android |
| '-Xep:ArrayEquals:ERROR', |
| '-Xep:ArrayFillIncompatibleType:ERROR', |
| '-Xep:ArrayHashCode:ERROR', |
| '-Xep:ArrayToString:ERROR', |
| // '-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 |
| '-Xep:BadAnnotationImplementation:ERROR', |
| '-Xep:BadShiftAmount:ERROR', |
| '-Xep:BanClassLoader:ERROR', |
| // '-Xep:BanJNDI:OFF', // implemented with forbidden APIs instead |
| '-Xep:BoxedPrimitiveEquality:ERROR', |
| // '-Xep:BundleDeserializationCast:OFF', // we don't use android |
| '-Xep:ChainingConstructorIgnoresParameter:ERROR', |
| // '-Xep:CheckNotNullMultipleTimes:OFF', // we don't use guava |
| // '-Xep:CheckReturnValue:OFF', // we don't use these annotations |
| '-Xep:CollectionToArraySafeParameter:ERROR', |
| // '-Xep:ComparableType:OFF', |
| '-Xep:ComparingThisWithNull:ERROR', |
| '-Xep:ComparisonOutOfRange:ERROR', |
| // '-Xep:CompatibleWithAnnotationMisuse:OFF', // we don't use this annotation |
| // '-Xep:CompileTimeConstant:OFF', // we don't use this annotation |
| '-Xep:ComputeIfAbsentAmbiguousReference:ERROR', |
| '-Xep:ConditionalExpressionNumericPromotion:ERROR', |
| '-Xep:ConstantOverflow:ERROR', |
| // '-Xep:DaggerProvidesNull:OFF', // we don't use dagger |
| '-Xep:DangerousLiteralNull:ERROR', |
| '-Xep:DeadException:ERROR', |
| '-Xep:DeadThread:ERROR', |
| '-Xep:DereferenceWithNullBranch:ERROR', |
| '-Xep:DiscardedPostfixExpression:ERROR', |
| // '-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 |
| '-Xep:DuplicateBranches:ERROR', |
| '-Xep:DuplicateMapKeys:ERROR', |
| // '-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 |
| '-Xep:EqualsHashCode:ERROR', |
| '-Xep:EqualsNaN:ERROR', |
| '-Xep:EqualsNull:ERROR', |
| '-Xep:EqualsReference:ERROR', |
| '-Xep:EqualsWrongThing:ERROR', |
| // '-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 |
| // '-Xep:FormatString:OFF', |
| // '-Xep:FormatStringAnnotation:OFF', // we don't use this annotation |
| // '-Xep:FromTemporalAccessor:OFF', // we don't use .from(LocalDate) etc |
| '-Xep:FunctionalInterfaceMethodChanged:ERROR', |
| // '-Xep:FuturesGetCheckedIllegalExceptionType:OFF', // we don't use guava |
| // '-Xep:FuzzyEqualsShouldNotBeUsedInEqualsMethod:OFF', // we don't use guava |
| '-Xep:GetClassOnAnnotation:ERROR', |
| '-Xep:GetClassOnClass:ERROR', |
| // '-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 |
| '-Xep:HashtableContains:ERROR', |
| // '-Xep:IdentityBinaryExpression:OFF', |
| '-Xep:IdentityHashMapBoxing:ERROR', |
| // '-Xep:IgnoredPureGetter:OFF', // we don't use these annotations |
| // '-Xep:Immutable:OFF', // we don't use this annotation |
| // '-Xep:ImpossibleNullComparison:OFF', // we don't use protobuf |
| '-Xep:Incomparable:ERROR', |
| // '-Xep:IncompatibleArgumentType:OFF', // we don't use this annotation |
| // '-Xep:IncompatibleModifiers:OFF', // we don't use this annotation |
| '-Xep:IndexOfChar:ERROR', |
| '-Xep:InexactVarargsConditional:ERROR', |
| // '-Xep:InfiniteRecursion:OFF', |
| // '-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) |
| // '-Xep:InvalidPatternSyntax:OFF', |
| // '-Xep:InvalidTimeZoneID:OFF', // we don't use getTimeZone with constant IDs except UTC/GMT |
| // '-Xep:InvalidZoneId:OFF', // we don't use ZoneId.of |
| '-Xep:IsInstanceIncompatibleType:ERROR', |
| '-Xep:IsInstanceOfClass:ERROR', |
| // '-Xep:IsLoggableTagLength:OFF', // we don't use android |
| // '-Xep:JUnit3TestNotRun:OFF', // we don't use junit3 |
| '-Xep:JUnit4ClassAnnotationNonStatic:ERROR', |
| // '-Xep:JUnit4SetUpNotRun:OFF', // LuceneTestCase takes care |
| // '-Xep:JUnit4TearDownNotRun:OFF', // LuceneTestCase takes care |
| // '-Xep:JUnit4TestNotRun:OFF', // noisy |
| '-Xep:JUnit4TestsNotRunWithinEnclosed:ERROR', |
| '-Xep:JUnitAssertSameCheck:ERROR', |
| '-Xep:JUnitParameterMethodNotFound:ERROR', |
| // '-Xep:JavaxInjectOnAbstractMethod:OFF', // we don't this annotation |
| // '-Xep:JodaToSelf:OFF', // we don't use joda-time |
| // '-Xep:LenientFormatStringValidation:OFF' // we don't use these google libraries |
| // '-Xep:LiteByteStringUtf8:OFF', // we don't use protobuf |
| // '-Xep:LocalDateTemporalAmount:OFF', // we don't use LocalDate math |
| '-Xep:LockOnBoxedPrimitive:ERROR', |
| '-Xep:LoopConditionChecker:ERROR', |
| '-Xep:LossyPrimitiveCompare:ERROR', |
| '-Xep:MathRoundIntLong:ERROR', |
| // '-Xep:MislabeledAndroidString:OFF', // we don't use android |
| '-Xep:MisleadingEscapedSpace:ERROR', |
| // '-Xep:MissingRuntimeRetention:OFF', // we don't use this annotation |
| // '-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 |
| '-Xep:ModifyingCollectionWithItself:ERROR', |
| // '-Xep:MoreThanOneInjectableConstructor:OFF', // we don't use this annotation |
| // '-Xep:MustBeClosedChecker:OFF', // we don't use this annotation |
| '-Xep:NCopiesOfChar:ERROR', |
| // '-Xep:NoCanIgnoreReturnValueOnClasses:OFF', // we don't use this annotation |
| '-Xep:NonCanonicalStaticImport:ERROR', |
| // '-Xep:NonFinalCompileTimeConstant:OFF', // we don't use this annotation |
| '-Xep:NonRuntimeAnnotation:ERROR', |
| // '-Xep:NullArgumentForNonNullParameter:OFF', // we don't use this annotation |
| '-Xep:NullTernary:ERROR', |
| // '-Xep:NullableOnContainingClass:OFF', // we don't use this annotation |
| '-Xep:OptionalEquality:ERROR', |
| '-Xep:OptionalMapUnusedValue:ERROR', |
| '-Xep:OptionalOfRedundantMethod:ERROR', |
| // '-Xep:OverlappingQualifierAndScopeAnnotation:OFF', // we don't use this annotation |
| // '-Xep:OverridesJavaxInjectableMethod:OFF', // we don't use this annotation |
| '-Xep:PackageInfo:ERROR', |
| '-Xep:ParametersButNotParameterized:ERROR', |
| // '-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 |
| '-Xep:RandomCast:ERROR', |
| '-Xep:RandomModInteger:ERROR', |
| // '-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 |
| '-Xep:SelfAssertion:ERROR', |
| '-Xep:SelfAssignment:ERROR', |
| '-Xep:SelfComparison:ERROR', |
| '-Xep:SelfEquals:ERROR', |
| // '-Xep:SetUnrecognized:OFF', // we don't use protobuf |
| // '-Xep:ShouldHaveEvenArgs:OFF', // we don't use truth |
| '-Xep:SizeGreaterThanOrEqualsZero:ERROR', |
| '-Xep:StreamToString:ERROR', |
| '-Xep:StringBuilderInitWithChar:ERROR', |
| '-Xep:SubstringOfZero:ERROR', |
| '-Xep:SuppressWarningsDeprecated:ERROR', |
| // '-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:TryFailThrowable:OFF', |
| '-Xep:TypeParameterQualifier:ERROR', |
| '-Xep:UnicodeDirectionalityCharacters:ERROR', |
| '-Xep:UnicodeInCode:ERROR', |
| '-Xep:UnnecessaryCheckNotNull:ERROR', |
| '-Xep:UnnecessaryTypeArgument:ERROR', |
| '-Xep:UnsafeWildcard:ERROR', |
| '-Xep:UnusedAnonymousClass:ERROR', |
| '-Xep:UnusedCollectionModifiedInPlace:ERROR', |
| '-Xep:VarTypeName:ERROR', |
| // '-Xep:WrongOneof:OFF', // we don't use protobuf |
| '-Xep:XorPower:ERROR', |
| // '-Xep:ZoneIdOfZ:OFF', // we don't use ZoneId.of |
| |
| // On by Default : WARNING |
| |
| // '-Xep:ASTHelpersSuggestions:OFF', // we don't use ASTHelpers |
| // '-Xep:AlmostJavadoc:OFF', // noisy (e.g. commented-out code misinterpreted as javadocs) |
| // '-Xep:AlreadyChecked:OFF', // TODO: there are problems |
| // '-Xep:AmbiguousMethodReference:OFF', |
| // '-Xep:AnnotateFormatMethod:OFF', // we don't use this annotation |
| // '-Xep:ArgumentSelectionDefectChecker:OFF', // noisy |
| // '-Xep:ArrayAsKeyOfSetOrMap:OFF', // TODO: there are problems |
| // '-Xep:ArrayRecordComponent:OFF', // TODO: there are problems |
| '-Xep:AssertEqualsArgumentOrderChecker:WARN', |
| '-Xep:AssertThrowsMultipleStatements:WARN', |
| // '-Xep:AssertionFailureIgnored:OFF', // TODO: there are problems |
| // '-Xep:AssistedInjectAndInjectOnSameConstructor:OFF', // we don't use this annotation |
| '-Xep:AttemptedNegativeZero:WARN', |
| // '-Xep:AutoValueBoxedValues:OFF', // we don't use autovalue |
| // '-Xep:AutoValueFinalMethods:OFF', // we don't use autovalue |
| // '-Xep:AutoValueImmutableFields:OFF', // we don't use autovalue |
| // '-Xep:AutoValueSubclassLeaked:OFF', // we don't use autovalue |
| '-Xep:BadComparable:WARN', |
| // '-Xep:BadImport:OFF', // TODO: there are problems |
| // '-Xep:BadInstanceof:OFF', // TODO: there are problems |
| '-Xep:BareDotMetacharacter:WARN', |
| // '-Xep:BigDecimalEquals:OFF', // BigDecimal barely used, can use forbidden-apis for this |
| // '-Xep:BigDecimalLiteralDouble:OFF', // BigDecimal barely used, can use forbidden-apis for this |
| // '-Xep:BoxedPrimitiveConstructor:OFF', // we have forbiddenapis for that |
| // '-Xep:BugPatternNaming:OFF', // we don't use this annotation |
| // '-Xep:ByteBufferBackingArray:OFF', |
| // '-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 |
| // '-Xep:ClassInitializationDeadlock:OFF', // TODO: there are problems |
| '-Xep:ClassNewInstance:WARN', |
| // '-Xep:CloseableProvides:OFF', // we don't use this annotation |
| '-Xep:ClosingStandardOutputStreams:WARN', |
| // '-Xep:CollectionUndefinedEquality:OFF', // TODO: there are problems |
| '-Xep:CollectorShouldNotUseState:WARN', |
| '-Xep:ComparableAndComparator:WARN', |
| '-Xep:CompareToZero:WARN', |
| // '-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 |
| // '-Xep:DefaultLocale:OFF', // we have forbiddenapis for that |
| // '-Xep:DefaultPackage:OFF', |
| '-Xep:DeprecatedVariable:WARN', |
| '-Xep:DeeplyNested:WARN', |
| // '-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 |
| '-Xep:DuplicateDateFormatField:WARN', |
| '-Xep:EmptyBlockTag:WARN', |
| // '-Xep:EmptyCatch:OFF', // ECJ takes care |
| // '-Xep:EmptySetMultibindingContributions:OFF', // we don't use this annotation |
| // '-Xep:EnumOrdinal:OFF', // noisy |
| // '-Xep:EqualsGetClass:OFF', // noisy |
| // '-Xep:EqualsIncompatibleType:OFF', |
| // '-Xep:EqualsUnsafeCast:OFF', // noisy |
| '-Xep:EqualsUsingHashCode:WARN', |
| '-Xep:ErroneousBitwiseExpression:WARN', |
| '-Xep:ErroneousThreadPoolConstructorChecker:WARN', |
| // '-Xep:EscapedEntity:OFF', |
| // '-Xep:ExtendingJUnitAssert:OFF', // noisy |
| // '-Xep:ExtendsObject:OFF', // TODO: there are problems |
| // '-Xep:FallThrough:OFF', // TODO: there are problems |
| '-Xep:Finalize:WARN', // catches actual finalizers that don't call super |
| // '-Xep:Finally:OFF', // TODO: there are problems |
| '-Xep:FloatCast:WARN', |
| '-Xep:FloatingPointAssertionWithinEpsilon:WARN', |
| // '-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 |
| // '-Xep:FutureTransformAsync:OFF', // we don't use these google libraries |
| '-Xep:GetClassOnEnum:WARN', |
| // '-Xep:GuiceNestedCombine:OFF', // we don't use guice |
| // '-Xep:HidingField:OFF', // noisy |
| '-Xep:ICCProfileGetInstance:WARN', |
| // '-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 |
| // '-Xep:IgnoredPureGetter:OFF', // we don't use these google libraries |
| '-Xep:IncorrectMainMethod:WARN', |
| '-Xep:IncrementInForLoopAndHeader:WARN', |
| '-Xep:InheritDoc:WARN', |
| // '-Xep:InjectOnBugCheckers:OFF', // we don't use this annotation |
| // '-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 |
| // '-Xep:InlineTrivialConstant:OFF', // stylistic |
| // '-Xep:InputStreamSlowMultibyteRead:OFF', |
| '-Xep:InstanceOfAndCastMatchWrongType:WARN', |
| // '-Xep:IntLongMath:OFF', // noisy |
| // '-Xep:InvalidBlockTag:OFF', // noisy (e.g. lucene.experimental) |
| // '-Xep:InvalidInlineTag:OFF', // TODO: there are problems |
| '-Xep:InvalidLink:WARN', |
| // '-Xep:InvalidParam:OFF', // TODO: there are problems |
| '-Xep:InvalidThrows:WARN', |
| '-Xep:InvalidThrowsLink:WARN', |
| '-Xep:IterableAndIterator:WARN', |
| // '-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:JavaDurationGetSecondsToToSeconds: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:JUnitIncompatibleType:WARN', |
| // '-Xep:LabelledBreakTarget:OFF', // stylistic |
| // '-Xep:LiteEnumValueOf:OFF', // we don't use protobuf |
| // '-Xep:LiteProtoToString:OFF', // we don't use protobuf |
| // '-Xep:LockNotBeforeTry:OFF', // TODO: there are problems |
| // '-Xep:LockOnNonEnclosingClassLiteral:OFF', // TODO: there are problems |
| '-Xep:LogicalAssignment:WARN', |
| '-Xep:LongDoubleConversion:WARN', |
| '-Xep:LongFloatConversion:WARN', |
| '-Xep:LoopOverCharArray:WARN', |
| '-Xep:MalformedInlineTag:WARN', |
| // '-Xep:MathAbsoluteNegative:OFF', // TODO: there are problems |
| // '-Xep:MemoizeConstantVisitorStateLookups:OFF', // we don't use this class |
| // '-Xep:MisformattedTestData:OFF', // stylistic |
| // '-Xep:MissingCasesInEnumSwitch:OFF', // redundant with ECJ incompleteEnumSwitch/missingEnumCaseDespiteDefault |
| // '-Xep:MissingFail:OFF', // TODO: there are problems |
| '-Xep:MissingImplementsComparable:WARN', |
| // '-Xep:MissingOverride:OFF', // ECJ takes care of this |
| // '-Xep:MissingRefasterAnnotation:OFF', // we don't use this annotation |
| // '-Xep:MissingSummary:OFF', // TODO: there are problems |
| // '-Xep:MixedMutabilityReturnType:OFF', // noisy |
| // '-Xep:MockitoDoSetup:OFF', // we don't use mocking libraries |
| // '-Xep:MockNotUsedInProduction:OFF', // we don't use mocking libraries |
| // '-Xep:ModifiedButNotUsed:OFF', // TODO: there are problems |
| '-Xep:ModifyCollectionInEnhancedForLoop:WARN', |
| '-Xep:ModifySourceCollectionInStream:WARN', |
| '-Xep:MultimapKeys:WARN', |
| // '-Xep:MultipleNullnessAnnotations:OFF', // we don't use these annotations |
| '-Xep:MultipleParallelOrSequentialCalls:WARN', |
| '-Xep:MultipleUnaryOperatorsInMethodCall:WARN', |
| // '-Xep:MutableGuiceModule:OFF', // we don't use guice |
| // '-Xep:MutablePublicArray:OFF', // TODO: there are problems |
| '-Xep:NamedLikeContextualKeyword:WARN', |
| '-Xep:NarrowCalculation:WARN', |
| // '-Xep:NarrowingCompoundAssignment:OFF', // noisy |
| '-Xep:NegativeCharLiteral:WARN', |
| '-Xep:NestedInstanceOfConditions:WARN', |
| // '-Xep:NewFileSystem:OFF', // we don't create new filesystems |
| // '-Xep:NonApiType:OFF', // noisy |
| // '-Xep:NonAtomicVolatileUpdate:OFF', // TODO: there are problems |
| // '-Xep:NonCanonicalType:OFF', // noisy |
| '-Xep:NonFinalStaticField:WARN', |
| '-Xep:NonOverridingEquals:WARN', |
| '-Xep:NotJavadoc:WARN', |
| '-Xep:NullOptional:WARN', |
| // '-Xep:NullableConstructor:OFF', // we don't use this annotation |
| '-Xep:NullableOptional:WARN', |
| // '-Xep:NullablePrimitive:OFF', // we don't use this annotation |
| // '-Xep:NullablePrimitiveArray:OFF', // we don't use this annotation |
| // '-Xep:NullableTypeParameter:OFF', // we don't use this annotation |
| // '-Xep:NullableVoid:OFF', // we don't use this annotation |
| // '-Xep:NullableWildcard:OFF', // we don't use this annotation |
| '-Xep:ObjectEqualsForPrimitives:WARN', |
| // '-Xep:ObjectToString:OFF', // TODO: there are problems |
| // '-Xep:ObjectsHashCodePrimitive:OFF', // TODO: there are problems |
| // '-Xep:OperatorPrecedence:OFF', // noisy |
| '-Xep:OptionalMapToOptional:WARN', |
| '-Xep:OptionalNotPresent:WARN', |
| '-Xep:OrphanedFormatString:WARN', |
| // '-Xep:OutlineNone:OFF', // we don't use gwt |
| '-Xep:OverrideThrowableToString:WARN', |
| '-Xep:Overrides:WARN', |
| // '-Xep:OverridesGuiceInjectableMethod:OFF', // we don't use guice |
| '-Xep:OverridingMethodInconsistentArgumentNamesChecker:WARN', |
| '-Xep:PatternMatchingInstanceof:WARN', |
| // '-Xep:ParameterName:OFF', // we don't pass parameters with comments in this way |
| // '-Xep:PreconditionsCheckNotNullRepeated:OFF', // we don't use guava |
| '-Xep:PrimitiveAtomicReference:WARN', |
| // '-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 |
| '-Xep:ReachabilityFenceUsage:WARN', |
| // '-Xep:RedundantControlFlow:OFF', // stylistic |
| // '-Xep:RedundantSetterCall:OFF', // we don't use protobuf |
| // '-Xep:ReferenceEquality:OFF', // noisy |
| '-Xep:RethrowReflectiveOperationExceptionAsLinkageError:WARN', |
| // '-Xep:ReturnAtTheEndOfVoidFunction:OFF', // stylistic |
| '-Xep:ReturnFromVoid:WARN', |
| // '-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 |
| '-Xep:StatementSwitchToExpressionSwitch:WARN', |
| // '-Xep:StaticAssignmentInConstructor:OFF', |
| // '-Xep:StaticAssignmentOfThrowable:OFF', // noisy |
| // '-Xep:StaticGuardedByInstance:OFF', |
| // '-Xep:StaticMockMember:OFF', // we don't use mock libraries |
| // '-Xep:StreamResourceLeak:OFF', // TODO: there are problems |
| '-Xep:StreamToIterable:WARN', |
| // '-Xep:StringCaseLocaleUsage:OFF', // noisy, can use forbidden-apis for this |
| '-Xep:StringCharset:WARN', |
| '-Xep:StringFormatWithLiteral:WARN', |
| // '-Xep:StringSplitter:OFF', // noisy, can use forbidden-apis for this |
| '-Xep:SystemConsoleNull:WARN', |
| '-Xep:SunApi:WARN', |
| '-Xep:SuperCallToObjectMethod:WARN', |
| // '-Xep:SwigMemoryLeak:OFF', // we don't use swig |
| // '-Xep:SynchronizeOnNonFinalField:OFF', // noisy |
| // '-Xep:ThreadJoinLoop:OFF', |
| // '-Xep:ThreadLocalUsage:OFF', // noisy |
| // '-Xep:ThreadPriorityCheck:OFF', // noisy, forbidden APIs can do this |
| // '-Xep:ThrowIfUncheckedKnownUnchecked:OFF', // we don't use these google libraries |
| '-Xep:ThreeLetterTimeZoneID:WARN', |
| '-Xep:TimeUnitConversionChecker:WARN', |
| // '-Xep:ToStringReturnsNull:OFF', // TODO: there are problems |
| // '-Xep:TruthAssertExpected:OFF', // we don't use truth |
| // '-Xep:TruthConstantAsserts:OFF', // we don't use truth |
| // '-Xep:TruthContainsExactlyElementsInUsage: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 |
| '-Xep:TypeNameShadowing:WARN', |
| // '-Xep:TypeParameterShadowing:OFF', |
| // '-Xep:TypeParameterUnusedInFormals:OFF', |
| '-Xep:URLEqualsHashCode:WARN', |
| // '-Xep:UndefinedEquals:OFF', // TODO: there are problems |
| // '-Xep:UnescapedEntity:OFF', // TODO: there are problems |
| // '-Xep:UnicodeEscape:OFF', // noisy |
| '-Xep:UnnecessaryAsync:WARN', |
| // '-Xep:UnnecessaryAssignment:OFF', // we don't use these annotations |
| '-Xep:UnnecessaryBreakInSwitch:WARN', |
| // '-Xep:UnnecessaryLambda:OFF', // TODO: there are problems |
| // '-Xep:UnnecessaryLongToIntConversion:OFF', // TODO: there are problems |
| // '-Xep:UnnecessaryMethodInvocationMatcher:OFF', // we don't use spring |
| '-Xep:UnnecessaryMethodReference:WARN', |
| // '-Xep:UnnecessaryParentheses:OFF', // noisy |
| '-Xep:UnnecessaryStringBuilder:WARN', |
| // '-Xep:UnnecessaryTestMethodPrefix:OFF', // stylistic |
| // '-Xep:UnqualifiedYield:OFF', // javac takes care |
| '-Xep:UnrecognisedJavadocTag:WARN', |
| // '-Xep:UnsafeFinalization:OFF', // we don't use finalizers, deprecated for removal, fails build |
| '-Xep:UnsafeReflectiveConstructionCast:WARN', |
| // '-Xep:UnsynchronizedOverridesSynchronized:OFF', // TODO: there are problems |
| // '-Xep:UnusedLabel:OFF', // TODO: there are problems |
| // '-Xep:UnusedMethod:OFF', // TODO: there are problems |
| '-Xep:UnusedNestedClass:WARN', |
| // '-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 |
| '-Xep:VariableNameSameAsType:WARN', |
| '-Xep:VoidUsed:WARN', |
| // '-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 |
| ] |
| } |
| } |
| } |
| } |