]> source.dussan.org Git - jgit.git/commitdiff
errorprone: Disable javadoc checks in tests 86/1203886/2
authorIvan Frade <ifrade@google.com>
Mon, 11 Nov 2024 19:07:21 +0000 (11:07 -0800)
committerMatthias Sohn <matthias.sohn@sap.com>
Mon, 11 Nov 2024 20:58:45 +0000 (21:58 +0100)
Errorprone finds many problems in the tests javadocs. This is noisy in
the logs, but fixing them also disturbs the project history and can
complicate merges.

Disable the javadoc checks in the tests packages. We can fix those
javadocs if some other modification happen in the file (as we fix
older coding style).

Change-Id: Ic221b60afe77ed9c207adbefd9117d2e26107792

tools/BUILD

index 8c424b357b19aeaab0cc3a2d12545dbd6fe101b6..844f0049e686df4d1254ed695efc869fbe8ab78d 100644 (file)
@@ -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/...",
+    ],
+)