Increase maxwarns to -1 (#291) Please see https://github.com/bazelbuild/bazel/issues/25927#issuecomment-2825206105 It's important not to filter out any warnings otherwise the lint warnings are not surfaced and then any attempt to do `-Werror` can fail with what may be observed as spurious (affect other parts of the codebase). This is maybe a "breaking change" only if someone has enabled `-Werror` and may now see additional errors -- although that was in fact their intention... Closes #291 COPYBARA_INTEGRATE_REVIEW=https://github.com/bazelbuild/rules_java/pull/291 from fzakaria:patch-1 6938d218c5d8c3640f9c1d98cbf48e55b7f2639d PiperOrigin-RevId: 819643216 Change-Id: I193e3fca51a56adc6ffa8623ef18729e633623e6
diff --git a/toolchains/default_java_toolchain.bzl b/toolchains/default_java_toolchain.bzl index f836f8f..5d1d54a 100644 --- a/toolchains/default_java_toolchain.bzl +++ b/toolchains/default_java_toolchain.bzl
@@ -65,6 +65,9 @@ "-Xep:LenientFormatStringValidation:OFF", "-Xep:ReturnMissingNullable:OFF", "-Xep:UseCorrectAssertInTests:OFF", + # Please see https://github.com/bazelbuild/bazel/issues/25927#issuecomment-2825206105 + # we need to make sure not to filter any warnings so that Bazel can trigger them as errors. + "-Xmaxwarns -1", ] # If this is changed, the docs for "{,tool_}java_language_version" also