2018-08-26 16:14:32 +02:00
|
|
|
load(
|
|
|
|
"@bazel_tools//tools/jdk:default_java_toolchain.bzl",
|
|
|
|
"JDK9_JVM_OPTS",
|
|
|
|
"default_java_toolchain",
|
|
|
|
)
|
2019-09-08 14:59:29 +02:00
|
|
|
load("@rules_java//java:defs.bzl", "java_package_configuration")
|
2018-08-26 16:14:32 +02:00
|
|
|
|
|
|
|
default_java_toolchain(
|
|
|
|
name = "error_prone_warnings_toolchain",
|
2018-11-01 08:37:29 +01:00
|
|
|
bootclasspath = ["@bazel_tools//tools/jdk:platformclasspath.jar"],
|
2018-08-26 16:14:32 +02:00
|
|
|
jvm_opts = JDK9_JVM_OPTS,
|
|
|
|
package_configuration = [
|
|
|
|
":error_prone",
|
|
|
|
],
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
2019-05-26 10:47:08 +02:00
|
|
|
# Error Prone errors enabled by default; see ../.bazelrc for how this is
|
|
|
|
# enabled. This warnings list is originally based on:
|
2018-08-26 16:14:32 +02:00
|
|
|
# https://github.com/bazelbuild/BUILD_file_generator/blob/master/tools/bazel_defs/java.bzl
|
2019-05-26 10:47:08 +02:00
|
|
|
# However, feel free to add any additional errors. Thus far they have all been pretty useful.
|
2018-08-26 16:14:32 +02:00
|
|
|
java_package_configuration(
|
|
|
|
name = "error_prone",
|
|
|
|
javacopts = [
|
|
|
|
"-XepDisableWarningsInGeneratedCode",
|
|
|
|
"-Xep:MissingCasesInEnumSwitch:ERROR",
|
|
|
|
"-Xep:ReferenceEquality:WARN",
|
|
|
|
"-Xep:StringEquality:WARN",
|
2019-05-26 11:03:07 +02:00
|
|
|
"-Xep:WildcardImport:ERROR",
|
2018-08-26 16:14:32 +02:00
|
|
|
"-Xep:AmbiguousMethodReference:WARN",
|
2019-05-26 11:03:07 +02:00
|
|
|
"-Xep:BadAnnotationImplementation:ERROR",
|
2018-08-26 16:14:32 +02:00
|
|
|
"-Xep:BadComparable:WARN",
|
|
|
|
"-Xep:BoxedPrimitiveConstructor:ERROR",
|
2019-05-26 11:03:07 +02:00
|
|
|
"-Xep:CannotMockFinalClass:ERROR",
|
2018-11-08 03:09:54 +01:00
|
|
|
"-Xep:ClassCanBeStatic:ERROR",
|
2018-08-26 16:14:32 +02:00
|
|
|
"-Xep:ClassNewInstance:WARN",
|
2018-09-30 10:02:11 +02:00
|
|
|
"-Xep:DefaultCharset:ERROR",
|
2019-05-26 11:03:07 +02:00
|
|
|
"-Xep:DoubleCheckedLocking:ERROR",
|
|
|
|
"-Xep:ElementsCountedInLoop:ERROR",
|
|
|
|
"-Xep:EqualsHashCode:ERROR",
|
|
|
|
"-Xep:EqualsIncompatibleType:ERROR",
|
2018-09-25 04:59:11 +02:00
|
|
|
"-Xep:ExpectedExceptionChecker:ERROR",
|
2018-08-26 16:14:32 +02:00
|
|
|
"-Xep:Finally:WARN",
|
2019-05-26 11:03:07 +02:00
|
|
|
"-Xep:FloatingPointLiteralPrecision:ERROR",
|
|
|
|
"-Xep:FragmentInjection:ERROR",
|
|
|
|
"-Xep:FragmentNotInstantiable:ERROR",
|
|
|
|
"-Xep:FunctionalInterfaceClash:ERROR",
|
2018-08-26 16:14:32 +02:00
|
|
|
"-Xep:FutureReturnValueIgnored:WARN",
|
2019-05-26 11:03:07 +02:00
|
|
|
"-Xep:GetClassOnEnum:ERROR",
|
|
|
|
"-Xep:ImmutableAnnotationChecker:ERROR",
|
2018-08-26 16:14:32 +02:00
|
|
|
"-Xep:ImmutableEnumChecker:WARN",
|
2019-05-26 11:03:07 +02:00
|
|
|
"-Xep:IncompatibleModifiers:ERROR",
|
|
|
|
"-Xep:InjectOnConstructorOfAbstractClass:ERROR",
|
|
|
|
"-Xep:InputStreamSlowMultibyteRead:ERROR",
|
|
|
|
"-Xep:IterableAndIterator:ERROR",
|
|
|
|
"-Xep:JUnit3FloatingPointComparisonWithoutDelta:ERROR",
|
|
|
|
"-Xep:JUnitAmbiguousTestClass:ERROR",
|
|
|
|
"-Xep:LiteralClassName:ERROR",
|
2018-09-29 06:23:22 +02:00
|
|
|
"-Xep:MissingFail:ERROR",
|
2019-05-26 11:03:07 +02:00
|
|
|
"-Xep:MissingOverride:ERROR",
|
|
|
|
"-Xep:MutableConstantField:ERROR",
|
2018-08-26 16:14:32 +02:00
|
|
|
"-Xep:NarrowingCompoundAssignment:WARN",
|
2019-05-26 11:03:07 +02:00
|
|
|
"-Xep:NonAtomicVolatileUpdate:ERROR",
|
2018-08-26 16:14:32 +02:00
|
|
|
"-Xep:NonOverridingEquals:WARN",
|
2019-05-26 11:03:07 +02:00
|
|
|
"-Xep:NullableConstructor:ERROR",
|
|
|
|
"-Xep:NullablePrimitive:ERROR",
|
|
|
|
"-Xep:NullableVoid:ERROR",
|
2018-08-26 16:14:32 +02:00
|
|
|
"-Xep:OperatorPrecedence:WARN",
|
2019-05-26 11:03:07 +02:00
|
|
|
"-Xep:OverridesGuiceInjectableMethod:ERROR",
|
|
|
|
"-Xep:PreconditionsInvalidPlaceholder:ERROR",
|
|
|
|
"-Xep:ProtoFieldPreconditionsCheckNotNull:ERROR",
|
|
|
|
"-Xep:ProtocolBufferOrdinal:ERROR",
|
|
|
|
"-Xep:RequiredModifiers:ERROR",
|
2018-08-26 16:14:32 +02:00
|
|
|
"-Xep:ShortCircuitBoolean:WARN",
|
2019-05-26 11:03:07 +02:00
|
|
|
"-Xep:SimpleDateFormatConstant:ERROR",
|
|
|
|
"-Xep:StaticGuardedByInstance:ERROR",
|
|
|
|
"-Xep:SynchronizeOnNonFinalField:ERROR",
|
|
|
|
"-Xep:TruthConstantAsserts:ERROR",
|
|
|
|
"-Xep:TypeParameterShadowing:ERROR",
|
2018-08-26 16:14:32 +02:00
|
|
|
"-Xep:TypeParameterUnusedInFormals:WARN",
|
2019-05-26 11:03:07 +02:00
|
|
|
"-Xep:URLEqualsHashCode:ERROR",
|
|
|
|
"-Xep:UnsynchronizedOverridesSynchronized:ERROR",
|
|
|
|
"-Xep:WaitNotInLoop:ERROR",
|
2018-08-26 16:14:32 +02:00
|
|
|
],
|
|
|
|
packages = ["error_prone_packages"],
|
|
|
|
)
|
|
|
|
|
|
|
|
package_group(
|
|
|
|
name = "error_prone_packages",
|
|
|
|
packages = [
|
|
|
|
"//org.eclipse.jgit.ant.test/...",
|
2018-11-06 05:50:04 +01:00
|
|
|
"//org.eclipse.jgit.ant/...",
|
2018-08-26 16:14:32 +02:00
|
|
|
"//org.eclipse.jgit.archive/...",
|
|
|
|
"//org.eclipse.jgit.http.apache/...",
|
|
|
|
"//org.eclipse.jgit.http.server/...",
|
|
|
|
"//org.eclipse.jgit.http.test/...",
|
|
|
|
"//org.eclipse.jgit.junit.http/...",
|
2018-11-06 05:50:04 +01:00
|
|
|
"//org.eclipse.jgit.junit/...",
|
2018-08-26 16:14:32 +02:00
|
|
|
"//org.eclipse.jgit.lfs.server.test/...",
|
2018-11-06 05:50:04 +01:00
|
|
|
"//org.eclipse.jgit.lfs.server/...",
|
2018-08-26 16:14:32 +02:00
|
|
|
"//org.eclipse.jgit.lfs.test/...",
|
2018-11-06 05:50:04 +01:00
|
|
|
"//org.eclipse.jgit.lfs/...",
|
2018-08-26 16:14:32 +02:00
|
|
|
"//org.eclipse.jgit.packaging/...",
|
|
|
|
"//org.eclipse.jgit.pgm.test/...",
|
2018-11-06 05:50:04 +01:00
|
|
|
"//org.eclipse.jgit.pgm/...",
|
2018-08-26 16:14:32 +02:00
|
|
|
"//org.eclipse.jgit.test/...",
|
|
|
|
"//org.eclipse.jgit.ui/...",
|
2018-11-06 05:50:04 +01:00
|
|
|
"//org.eclipse.jgit/...",
|
2018-08-26 16:14:32 +02:00
|
|
|
],
|
|
|
|
)
|