aboutsummaryrefslogtreecommitdiffstats
path: root/tools/BUILD
diff options
context:
space:
mode:
Diffstat (limited to 'tools/BUILD')
-rw-r--r--tools/BUILD46
1 files changed, 33 insertions, 13 deletions
diff --git a/tools/BUILD b/tools/BUILD
index 8c424b357b..844f0049e6 100644
--- a/tools/BUILD
+++ b/tools/BUILD
@@ -10,6 +10,7 @@ default_java_toolchain(
java_runtime = "@rules_java//toolchains:remotejdk_17",
package_configuration = [
":error_prone",
+ ":error_prone_tests",
],
source_version = "17",
target_version = "17",
@@ -22,6 +23,7 @@ default_java_toolchain(
java_runtime = "@rules_java//toolchains:remotejdk_21",
package_configuration = [
":error_prone",
+ ":error_prone_tests",
],
source_version = "21",
target_version = "21",
@@ -32,9 +34,7 @@ default_java_toolchain(
# enabled. This warnings list is originally based on:
# https://github.com/bazelbuild/BUILD_file_generator/blob/master/tools/bazel_defs/java.bzl
# However, feel free to add any additional errors. Thus far they have all been pretty useful.
-java_package_configuration(
- name = "error_prone",
- javacopts = [
+errorprone_checks = [
"-XepDisableWarningsInGeneratedCode",
# The XepDisableWarningsInGeneratedCode disables only warnings, but
# not errors. We should manually exclude all files generated by
@@ -422,37 +422,57 @@ java_package_configuration(
"-Xep:WrongOneof:ERROR",
"-Xep:XorPower:ERROR",
"-Xep:ZoneIdOfZ:ERROR",
- ],
+]
+
+
+exclude_in_tests = ["-Xep:EmptyBlockTag:WARN",
+ "-Xep:MissingSummary:WARN"]
+
+java_package_configuration(
+ name = "error_prone",
+ javacopts = errorprone_checks,
packages = ["error_prone_packages"],
)
+java_package_configuration(
+ name = "error_prone_tests",
+ javacopts = [ check for check in errorprone_checks if check not in exclude_in_tests],
+ packages = ["error_prone_packages_test"],
+)
+
package_group(
name = "error_prone_packages",
packages = [
- "//org.eclipse.jgit.ant.test/...",
"//org.eclipse.jgit.ant/...",
"//org.eclipse.jgit.archive/...",
- "//org.eclipse.jgit.gpg.bc.test/...",
"//org.eclipse.jgit.gpg.bc/...",
"//org.eclipse.jgit.http.apache/...",
"//org.eclipse.jgit.http.server/...",
- "//org.eclipse.jgit.http.test/...",
"//org.eclipse.jgit.junit.ssh/...",
"//org.eclipse.jgit.junit/...",
"//org.eclipse.jgit.junit/http/...",
- "//org.eclipse.jgit.lfs.server.test/...",
"//org.eclipse.jgit.lfs.server/...",
- "//org.eclipse.jgit.lfs.test/...",
"//org.eclipse.jgit.lfs/...",
- "//org.eclipse.jgit.pgm.test/...",
"//org.eclipse.jgit.pgm/...",
"//org.eclipse.jgit.ssh.apache.agent/...",
- "//org.eclipse.jgit.ssh.apache.test/...",
"//org.eclipse.jgit.ssh.apache/...",
- "//org.eclipse.jgit.ssh.jsch.test/...",
"//org.eclipse.jgit.ssh.jsch/...",
- "//org.eclipse.jgit.test/...",
"//org.eclipse.jgit.ui/...",
"//org.eclipse.jgit/...",
],
)
+
+package_group(
+ name = "error_prone_packages_test",
+ packages = [
+ "//org.eclipse.jgit.ant.test/...",
+ "//org.eclipse.jgit.gpg.bc.test/...",
+ "//org.eclipse.jgit.http.test/...",
+ "//org.eclipse.jgit.lfs.server.test/...",
+ "//org.eclipse.jgit.lfs.test/...",
+ "//org.eclipse.jgit.pgm.test/...",
+ "//org.eclipse.jgit.ssh.apache.test/...",
+ "//org.eclipse.jgit.ssh.jsch.test/...",
+ "//org.eclipse.jgit.test/...",
+ ],
+)