You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

BUILD 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. load(
  2. "@bazel_tools//tools/jdk:default_java_toolchain.bzl",
  3. "JDK9_JVM_OPTS",
  4. "default_java_toolchain",
  5. )
  6. default_java_toolchain(
  7. name = "error_prone_warnings_toolchain",
  8. bootclasspath = ["@bazel_tools//tools/jdk:platformclasspath.jar"],
  9. jvm_opts = JDK9_JVM_OPTS,
  10. package_configuration = [
  11. ":error_prone",
  12. ],
  13. visibility = ["//visibility:public"],
  14. )
  15. # Error Prone errors enabled by default; see ../.bazelrc for how this is
  16. # enabled. This warnings list is originally based on:
  17. # https://github.com/bazelbuild/BUILD_file_generator/blob/master/tools/bazel_defs/java.bzl
  18. # However, feel free to add any additional errors. Thus far they have all been pretty useful.
  19. java_package_configuration(
  20. name = "error_prone",
  21. javacopts = [
  22. "-XepDisableWarningsInGeneratedCode",
  23. "-Xep:MissingCasesInEnumSwitch:ERROR",
  24. "-Xep:ReferenceEquality:WARN",
  25. "-Xep:StringEquality:WARN",
  26. "-Xep:WildcardImport:WARN",
  27. "-Xep:AmbiguousMethodReference:WARN",
  28. "-Xep:BadAnnotationImplementation:WARN",
  29. "-Xep:BadComparable:WARN",
  30. "-Xep:BoxedPrimitiveConstructor:ERROR",
  31. "-Xep:CannotMockFinalClass:WARN",
  32. "-Xep:ClassCanBeStatic:ERROR",
  33. "-Xep:ClassNewInstance:WARN",
  34. "-Xep:DefaultCharset:ERROR",
  35. "-Xep:DoubleCheckedLocking:WARN",
  36. "-Xep:ElementsCountedInLoop:WARN",
  37. "-Xep:EqualsHashCode:WARN",
  38. "-Xep:EqualsIncompatibleType:WARN",
  39. "-Xep:ExpectedExceptionChecker:ERROR",
  40. "-Xep:Finally:WARN",
  41. "-Xep:FloatingPointLiteralPrecision:WARN",
  42. "-Xep:FragmentInjection:WARN",
  43. "-Xep:FragmentNotInstantiable:WARN",
  44. "-Xep:FunctionalInterfaceClash:WARN",
  45. "-Xep:FutureReturnValueIgnored:WARN",
  46. "-Xep:GetClassOnEnum:WARN",
  47. "-Xep:ImmutableAnnotationChecker:WARN",
  48. "-Xep:ImmutableEnumChecker:WARN",
  49. "-Xep:IncompatibleModifiers:WARN",
  50. "-Xep:InjectOnConstructorOfAbstractClass:WARN",
  51. "-Xep:InputStreamSlowMultibyteRead:WARN",
  52. "-Xep:IterableAndIterator:WARN",
  53. "-Xep:JUnit3FloatingPointComparisonWithoutDelta:WARN",
  54. "-Xep:JUnitAmbiguousTestClass:WARN",
  55. "-Xep:LiteralClassName:WARN",
  56. "-Xep:MissingFail:ERROR",
  57. "-Xep:MissingOverride:WARN",
  58. "-Xep:MutableConstantField:WARN",
  59. "-Xep:NarrowingCompoundAssignment:WARN",
  60. "-Xep:NonAtomicVolatileUpdate:WARN",
  61. "-Xep:NonOverridingEquals:WARN",
  62. "-Xep:NullableConstructor:WARN",
  63. "-Xep:NullablePrimitive:WARN",
  64. "-Xep:NullableVoid:WARN",
  65. "-Xep:OperatorPrecedence:WARN",
  66. "-Xep:OverridesGuiceInjectableMethod:WARN",
  67. "-Xep:PreconditionsInvalidPlaceholder:WARN",
  68. "-Xep:ProtoFieldPreconditionsCheckNotNull:WARN",
  69. "-Xep:ProtocolBufferOrdinal:WARN",
  70. "-Xep:RequiredModifiers:WARN",
  71. "-Xep:ShortCircuitBoolean:WARN",
  72. "-Xep:SimpleDateFormatConstant:WARN",
  73. "-Xep:StaticGuardedByInstance:WARN",
  74. "-Xep:SynchronizeOnNonFinalField:WARN",
  75. "-Xep:TruthConstantAsserts:WARN",
  76. "-Xep:TypeParameterShadowing:WARN",
  77. "-Xep:TypeParameterUnusedInFormals:WARN",
  78. "-Xep:URLEqualsHashCode:WARN",
  79. "-Xep:UnsynchronizedOverridesSynchronized:WARN",
  80. "-Xep:WaitNotInLoop:WARN",
  81. ],
  82. packages = ["error_prone_packages"],
  83. )
  84. package_group(
  85. name = "error_prone_packages",
  86. packages = [
  87. "//org.eclipse.jgit.ant.test/...",
  88. "//org.eclipse.jgit.ant/...",
  89. "//org.eclipse.jgit.archive/...",
  90. "//org.eclipse.jgit.http.apache/...",
  91. "//org.eclipse.jgit.http.server/...",
  92. "//org.eclipse.jgit.http.test/...",
  93. "//org.eclipse.jgit.junit.http/...",
  94. "//org.eclipse.jgit.junit/...",
  95. "//org.eclipse.jgit.lfs.server.test/...",
  96. "//org.eclipse.jgit.lfs.server/...",
  97. "//org.eclipse.jgit.lfs.test/...",
  98. "//org.eclipse.jgit.lfs/...",
  99. "//org.eclipse.jgit.packaging/...",
  100. "//org.eclipse.jgit.pgm.test/...",
  101. "//org.eclipse.jgit.pgm/...",
  102. "//org.eclipse.jgit.test/...",
  103. "//org.eclipse.jgit.ui/...",
  104. "//org.eclipse.jgit/...",
  105. ],
  106. )