xref: /JGit/tools/BUILD (revision 4c33f70d5a591f4572b32186b39de4344d8bfe65)
17d89f0a0SDavid Ostrovskyload(
27d89f0a0SDavid Ostrovsky    "@bazel_tools//tools/jdk:default_java_toolchain.bzl",
37d89f0a0SDavid Ostrovsky    "JDK9_JVM_OPTS",
47d89f0a0SDavid Ostrovsky    "default_java_toolchain",
57d89f0a0SDavid Ostrovsky)
67d89f0a0SDavid Ostrovsky
77d89f0a0SDavid Ostrovskydefault_java_toolchain(
87d89f0a0SDavid Ostrovsky    name = "error_prone_warnings_toolchain",
99625db20SDavid Ostrovsky    bootclasspath = ["@bazel_tools//tools/jdk:platformclasspath.jar"],
107d89f0a0SDavid Ostrovsky    jvm_opts = JDK9_JVM_OPTS,
117d89f0a0SDavid Ostrovsky    package_configuration = [
127d89f0a0SDavid Ostrovsky        ":error_prone",
137d89f0a0SDavid Ostrovsky    ],
147d89f0a0SDavid Ostrovsky    visibility = ["//visibility:public"],
157d89f0a0SDavid Ostrovsky)
167d89f0a0SDavid Ostrovsky
17*4c33f70dSDavid Pursehouse# Error Prone errors enabled by default; see ../.bazelrc for how this is
18*4c33f70dSDavid Pursehouse# enabled. This warnings list is originally based on:
197d89f0a0SDavid Ostrovsky# https://github.com/bazelbuild/BUILD_file_generator/blob/master/tools/bazel_defs/java.bzl
20*4c33f70dSDavid Pursehouse# However, feel free to add any additional errors. Thus far they have all been pretty useful.
217d89f0a0SDavid Ostrovskyjava_package_configuration(
227d89f0a0SDavid Ostrovsky    name = "error_prone",
237d89f0a0SDavid Ostrovsky    javacopts = [
247d89f0a0SDavid Ostrovsky        "-XepDisableWarningsInGeneratedCode",
257d89f0a0SDavid Ostrovsky        "-Xep:MissingCasesInEnumSwitch:ERROR",
267d89f0a0SDavid Ostrovsky        "-Xep:ReferenceEquality:WARN",
277d89f0a0SDavid Ostrovsky        "-Xep:StringEquality:WARN",
287d89f0a0SDavid Ostrovsky        "-Xep:WildcardImport:WARN",
297d89f0a0SDavid Ostrovsky        "-Xep:AmbiguousMethodReference:WARN",
307d89f0a0SDavid Ostrovsky        "-Xep:BadAnnotationImplementation:WARN",
317d89f0a0SDavid Ostrovsky        "-Xep:BadComparable:WARN",
327d89f0a0SDavid Ostrovsky        "-Xep:BoxedPrimitiveConstructor:ERROR",
337d89f0a0SDavid Ostrovsky        "-Xep:CannotMockFinalClass:WARN",
341385f4b3SDavid Pursehouse        "-Xep:ClassCanBeStatic:ERROR",
357d89f0a0SDavid Ostrovsky        "-Xep:ClassNewInstance:WARN",
36d54fc955SDavid Pursehouse        "-Xep:DefaultCharset:ERROR",
377d89f0a0SDavid Ostrovsky        "-Xep:DoubleCheckedLocking:WARN",
387d89f0a0SDavid Ostrovsky        "-Xep:ElementsCountedInLoop:WARN",
397d89f0a0SDavid Ostrovsky        "-Xep:EqualsHashCode:WARN",
407d89f0a0SDavid Ostrovsky        "-Xep:EqualsIncompatibleType:WARN",
411f14c16aSDavid Pursehouse        "-Xep:ExpectedExceptionChecker:ERROR",
427d89f0a0SDavid Ostrovsky        "-Xep:Finally:WARN",
437d89f0a0SDavid Ostrovsky        "-Xep:FloatingPointLiteralPrecision:WARN",
447d89f0a0SDavid Ostrovsky        "-Xep:FragmentInjection:WARN",
457d89f0a0SDavid Ostrovsky        "-Xep:FragmentNotInstantiable:WARN",
467d89f0a0SDavid Ostrovsky        "-Xep:FunctionalInterfaceClash:WARN",
477d89f0a0SDavid Ostrovsky        "-Xep:FutureReturnValueIgnored:WARN",
487d89f0a0SDavid Ostrovsky        "-Xep:GetClassOnEnum:WARN",
497d89f0a0SDavid Ostrovsky        "-Xep:ImmutableAnnotationChecker:WARN",
507d89f0a0SDavid Ostrovsky        "-Xep:ImmutableEnumChecker:WARN",
517d89f0a0SDavid Ostrovsky        "-Xep:IncompatibleModifiers:WARN",
527d89f0a0SDavid Ostrovsky        "-Xep:InjectOnConstructorOfAbstractClass:WARN",
537d89f0a0SDavid Ostrovsky        "-Xep:InputStreamSlowMultibyteRead:WARN",
547d89f0a0SDavid Ostrovsky        "-Xep:IterableAndIterator:WARN",
557d89f0a0SDavid Ostrovsky        "-Xep:JUnit3FloatingPointComparisonWithoutDelta:WARN",
567d89f0a0SDavid Ostrovsky        "-Xep:JUnitAmbiguousTestClass:WARN",
577d89f0a0SDavid Ostrovsky        "-Xep:LiteralClassName:WARN",
58f5d7f93bSDavid Pursehouse        "-Xep:MissingFail:ERROR",
597d89f0a0SDavid Ostrovsky        "-Xep:MissingOverride:WARN",
607d89f0a0SDavid Ostrovsky        "-Xep:MutableConstantField:WARN",
617d89f0a0SDavid Ostrovsky        "-Xep:NarrowingCompoundAssignment:WARN",
627d89f0a0SDavid Ostrovsky        "-Xep:NonAtomicVolatileUpdate:WARN",
637d89f0a0SDavid Ostrovsky        "-Xep:NonOverridingEquals:WARN",
647d89f0a0SDavid Ostrovsky        "-Xep:NullableConstructor:WARN",
657d89f0a0SDavid Ostrovsky        "-Xep:NullablePrimitive:WARN",
667d89f0a0SDavid Ostrovsky        "-Xep:NullableVoid:WARN",
677d89f0a0SDavid Ostrovsky        "-Xep:OperatorPrecedence:WARN",
687d89f0a0SDavid Ostrovsky        "-Xep:OverridesGuiceInjectableMethod:WARN",
697d89f0a0SDavid Ostrovsky        "-Xep:PreconditionsInvalidPlaceholder:WARN",
707d89f0a0SDavid Ostrovsky        "-Xep:ProtoFieldPreconditionsCheckNotNull:WARN",
717d89f0a0SDavid Ostrovsky        "-Xep:ProtocolBufferOrdinal:WARN",
727d89f0a0SDavid Ostrovsky        "-Xep:RequiredModifiers:WARN",
737d89f0a0SDavid Ostrovsky        "-Xep:ShortCircuitBoolean:WARN",
747d89f0a0SDavid Ostrovsky        "-Xep:SimpleDateFormatConstant:WARN",
757d89f0a0SDavid Ostrovsky        "-Xep:StaticGuardedByInstance:WARN",
767d89f0a0SDavid Ostrovsky        "-Xep:SynchronizeOnNonFinalField:WARN",
777d89f0a0SDavid Ostrovsky        "-Xep:TruthConstantAsserts:WARN",
787d89f0a0SDavid Ostrovsky        "-Xep:TypeParameterShadowing:WARN",
797d89f0a0SDavid Ostrovsky        "-Xep:TypeParameterUnusedInFormals:WARN",
807d89f0a0SDavid Ostrovsky        "-Xep:URLEqualsHashCode:WARN",
817d89f0a0SDavid Ostrovsky        "-Xep:UnsynchronizedOverridesSynchronized:WARN",
827d89f0a0SDavid Ostrovsky        "-Xep:WaitNotInLoop:WARN",
837d89f0a0SDavid Ostrovsky    ],
847d89f0a0SDavid Ostrovsky    packages = ["error_prone_packages"],
857d89f0a0SDavid Ostrovsky)
867d89f0a0SDavid Ostrovsky
877d89f0a0SDavid Ostrovskypackage_group(
887d89f0a0SDavid Ostrovsky    name = "error_prone_packages",
897d89f0a0SDavid Ostrovsky    packages = [
907d89f0a0SDavid Ostrovsky        "//org.eclipse.jgit.ant.test/...",
913ec3ca0fSDavid Pursehouse        "//org.eclipse.jgit.ant/...",
927d89f0a0SDavid Ostrovsky        "//org.eclipse.jgit.archive/...",
937d89f0a0SDavid Ostrovsky        "//org.eclipse.jgit.http.apache/...",
947d89f0a0SDavid Ostrovsky        "//org.eclipse.jgit.http.server/...",
957d89f0a0SDavid Ostrovsky        "//org.eclipse.jgit.http.test/...",
967d89f0a0SDavid Ostrovsky        "//org.eclipse.jgit.junit.http/...",
973ec3ca0fSDavid Pursehouse        "//org.eclipse.jgit.junit/...",
987d89f0a0SDavid Ostrovsky        "//org.eclipse.jgit.lfs.server.test/...",
993ec3ca0fSDavid Pursehouse        "//org.eclipse.jgit.lfs.server/...",
1007d89f0a0SDavid Ostrovsky        "//org.eclipse.jgit.lfs.test/...",
1013ec3ca0fSDavid Pursehouse        "//org.eclipse.jgit.lfs/...",
1027d89f0a0SDavid Ostrovsky        "//org.eclipse.jgit.packaging/...",
1037d89f0a0SDavid Ostrovsky        "//org.eclipse.jgit.pgm.test/...",
1043ec3ca0fSDavid Pursehouse        "//org.eclipse.jgit.pgm/...",
1057d89f0a0SDavid Ostrovsky        "//org.eclipse.jgit.test/...",
1067d89f0a0SDavid Ostrovsky        "//org.eclipse.jgit.ui/...",
1073ec3ca0fSDavid Pursehouse        "//org.eclipse.jgit/...",
1087d89f0a0SDavid Ostrovsky    ],
1097d89f0a0SDavid Ostrovsky)
110