Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ repositories {
apply from: rootProject.file('gradle/java-publish.gradle')
apply from: rootProject.file('gradle/changelog.gradle')
allprojects {
apply from: rootProject.file('gradle/error-prone.gradle')
apply from: rootProject.file('gradle/rewrite.gradle')
apply from: rootProject.file('gradle/spotless.gradle')
}
Expand Down
263 changes: 263 additions & 0 deletions gradle/error-prone.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,263 @@
import static java.lang.System.getenv

apply plugin: 'net.ltgt.errorprone'

dependencies {
errorprone('com.google.errorprone:error_prone_core:2.42.0')
errorprone('tech.picnic.error-prone-support:error-prone-contrib:0.25.0')
errorprone('tech.picnic.error-prone-support:refaster-runner:0.25.0')
}

tasks.withType(JavaCompile).configureEach {
options.errorprone {
allErrorsAsWarnings = true
disableWarningsInGeneratedCode = true
disable(
// avoid
'StaticImport',
// bug
'AddNullMarkedToPackageInfo',
'Slf4jLogStatement',
'Slf4jLogStatement',
)
// dev opt-in
if (!getenv().containsKey('CI') && getenv('IN_PLACE')?.toBoolean()) {
// apply
errorproneArgs.addAll(
'-XepPatchLocation:IN_PLACE',
'-XepPatchChecks:' +
'AddNullMarkedToPackageInfo,' +
'AlwaysThrows,' +
'AmbiguousJsonCreator,' +
'AndroidInjectionBeforeSuper,' +
'ArrayEquals,' +
'ArrayFillIncompatibleType,' +
'ArrayHashCode,' +
'ArrayToString,' +
'ArraysAsListPrimitiveArray,' +
'AssertJNullnessAssertion,' +
'AsyncCallableReturnsNull,' +
'AsyncFunctionReturnsNull,' +
'AutoValueBuilderDefaultsInConstructor,' +
'AutoValueConstructorOrderChecker,' +
'AutowiredConstructor,' +
'BadAnnotationImplementation,' +
'BadShiftAmount,' +
'BanJNDI,' +
'BoxedPrimitiveEquality,' +
'BundleDeserializationCast,' +
'CanonicalAnnotationSyntax,' +
'CanonicalClassNameUsage,' +
'ChainingConstructorIgnoresParameter,' +
'CheckNotNullMultipleTimes,' +
'CheckReturnValue,' +
'ClassCastLambdaUsage,' +
'CollectionIncompatibleType,' +
'CollectionToArraySafeParameter,' +
'CollectorMutability,' +
'ComparableType,' +
'ComparingThisWithNull,' +
'ComparisonOutOfRange,' +
'CompatibleWithAnnotationMisuse,' +
'CompileTimeConstant,' +
'ComputeIfAbsentAmbiguousReference,' +
'ConditionalExpressionNumericPromotion,' +
'ConstantNaming,' +
'ConstantOverflow,' +
'DaggerProvidesNull,' +
'DangerousLiteralNull,' +
'DeadException,' +
'DeadThread,' +
'DefaultCharset,' +
'DereferenceWithNullBranch,' +
'DirectReturn,' +
'DiscardedPostfixExpression,' +
'DoNotCall,' +
'DoNotMock,' +
'DoubleBraceInitialization,' +
'DuplicateMapKeys,' +
'DurationFrom,' +
'DurationGetTemporalUnit,' +
'DurationTemporalUnit,' +
'DurationToLongTimeUnit,' +
'EagerStringFormatting,' +
'EmptyMethod,' +
'EmptyMonoZip,' +
'EqualsHashCode,' +
'EqualsNaN,' +
'EqualsNull,' +
'EqualsReference,' +
'EqualsWrongThing,' +
'ExplicitArgumentEnumeration,' +
'ExplicitEnumOrdering,' +
'FloggerFormatString,' +
'FloggerLogString,' +
'FloggerLogVarargs,' +
'FloggerSplitLogStatement,' +
'FluxFlatMapUsage,' +
'FluxImplicitBlock,' +
'ForOverride,' +
'FormatString,' +
'FormatStringAnnotation,' +
'FormatStringConcatenation,' +
'FromTemporalAccessor,' +
'FunctionalInterfaceMethodChanged,' +
'FunctionalInterfaceMethodChanged,' +
'FuturesGetCheckedIllegalExceptionType,' +
'FuzzyEqualsShouldNotBeUsedInEqualsMethod,' +
'GetClassOnAnnotation,' +
'GetClassOnClass,' +
'GuardedBy,' +
'GuiceAssistedInjectScoping,' +
'GuiceAssistedParameters,' +
'GuiceInjectOnFinalField,' +
'HashtableContains,' +
'IdentityBinaryExpression,' +
'IdentityConversion,' +
'IdentityHashMapBoxing,' +
'Immutable,' +
'ImmutableEnumChecker,' +
'ImmutablesSortedSetComparator,' +
'ImpossibleNullComparison,' +
'Incomparable,' +
'IncompatibleArgumentType,' +
'IncompatibleModifiers,' +
'IndexOfChar,' +
'InexactVarargsConditional,' +
'InfiniteRecursion,' +
'InjectMoreThanOneScopeAnnotationOnClass,' +
'InjectOnMemberAndConstructor,' +
'InlineMeValidator,' +
'InstantTemporalUnit,' +
'InvalidJavaTimeConstant,' +
'InvalidPatternSyntax,' +
'InvalidTimeZoneID,' +
'InvalidZoneId,' +
'IsInstanceIncompatibleType,' +
'IsInstanceLambdaUsage,' +
'IsInstanceOfClass,' +
'IsLoggableTagLength,' +
'JUnit3TestNotRun,' +
'JUnit4ClassAnnotationNonStatic,' +
'JUnit4SetUpNotRun,' +
'JUnit4TearDownNotRun,' +
'JUnit4TestNotRun,' +
'JUnit4TestsNotRunWithinEnclosed,' +
'JUnitAssertSameCheck,' +
'JUnitClassModifiers,' +
'JUnitMethodDeclaration,' +
'JUnitNullaryParameterizedTestDeclaration,' +
'JUnitParameterMethodNotFound,' +
'JUnitValueSource,' +
'JavaxInjectOnAbstractMethod,' +
'JodaToSelf,' +
'LenientFormatStringValidation,' +
'LexicographicalAnnotationAttributeListing,' +
'LexicographicalAnnotationListing,' +
'LiteByteStringUtf8,' +
'LocalDateTemporalAmount,' +
'LockOnBoxedPrimitive,' +
'LoopConditionChecker,' +
'LossyPrimitiveCompare,' +
'MathRoundIntLong,' +
'MislabeledAndroidString,' +
'MisleadingEmptyVarargs,' +
'MisleadingEscapedSpace,' +
'MisplacedScopeAnnotations,' +
'MissingOverride,' +
'MissingSuperCall,' +
'MissingTestCall,' +
'MisusedDayOfYear,' +
'MisusedWeekYear,' +
'MixedDescriptors,' +
'MockitoMockClassReference,' +
'MockitoStubbing,' +
'MockitoUsage,' +
'ModifyingCollectionWithItself,' +
'MongoDBTextFilterUsage,' +
'MoreThanOneInjectableConstructor,' +
'MustBeClosedChecker,' +
'NCopiesOfChar,' +
'NestedOptionals,' +
'NestedPublishers,' +
'NoCanIgnoreReturnValueOnClasses,' +
'NonCanonicalStaticImport,' +
'NonEmptyMono,' +
'NonFinalCompileTimeConstant,' +
'NonRuntimeAnnotation,' +
'NonStaticImport,' +
'NullArgumentForNonNullParameter,' +
'NullTernary,' +
'NullableOnContainingClass,' +
'OptionalEquality,' +
'OptionalMapUnusedValue,' +
'OptionalOfRedundantMethod,' +
'OptionalOrElseGet,' +
'OverlappingQualifierAndScopeAnnotation,' +
'OverridesJavaxInjectableMethod,' +
'PackageInfo,' +
'ParametersButNotParameterized,' +
'ParcelableCreator,' +
'PeriodFrom,' +
'PeriodGetTemporalUnit,' +
'PeriodTimeMath,' +
'PreconditionsInvalidPlaceholder,' +
'PrimitiveComparison,' +
'PrivateSecurityContractProtoAccess,' +
'ProtoBuilderReturnValueIgnored,' +
'ProtoStringFieldReferenceEquality,' +
'ProtoTruthMixedDescriptors,' +
'ProtocolBufferOrdinal,' +
'ProvidesMethodOutsideOfModule,' +
'RandomCast,' +
'RandomModInteger,' +
'RectIntersectReturnValueIgnored,' +
'RedundantSetterCall,' +
'RedundantStringConversion,' +
'RedundantStringEscape,' +
'RefasterAnyOfUsage,' +
'RequestMappingAnnotation,' +
'RequestParamType,' +
'RequiredModifiers,' +
'RestrictedApi,' +
'ReturnValueIgnored,' +
'SelfAssertion,' +
'SelfAssignment,' +
'SelfComparison,' +
'SelfEquals,' +
'SetUnrecognized,' +
'ShouldHaveEvenArgs,' +
'SizeGreaterThanOrEqualsZero,' +
'Slf4jLogStatement,' +
'Slf4jLoggerDeclarationSlf4jLoggerDeclaration,' +
'SpringMvcAnnotation,' +
'StreamToString,' +
'StringBuilderInitWithChar,' +
'StringJoin,' +
'SubstringOfZero,' +
'SuppressWarningsDeprecated,' +
'TemporalAccessorGetChronoField,' +
'TestParametersNotInitialized,' +
'TheoryButNoTheories,' +
'ThreadBuilderNameWithPlaceholder,' +
'ThrowIfUncheckedKnownChecked,' +
'ThrowNull,' +
'TimeZoneUsage,' +
'TreeToString,' +
'TryFailThrowable,' +
'TypeParameterQualifier,' +
'UnicodeDirectionalityCharacters,' +
'UnicodeInCode,' +
'UnnecessaryCheckNotNull,' +
'UnnecessaryTypeArgument,' +
'UnsafeWildcard,' +
'UnusedAnonymousClass,' +
'UnusedCollectionModifiedInPlace,' +
'VarTypeName,' +
'WrongOneof,' +
'XorPower,' +
'ZoneIdOfZ,'
)
}
}
}
Loading
Loading