error-prone icon indicating copy to clipboard operation
error-prone copied to clipboard

Allow to defuse `-XepDisableAllChecks` by `-XepEnableAllChecks` if it is present in javacopts later.

Open dkashyn-sfdc opened this issue 1 year ago • 0 comments

We have a particular toolchain config that contains -XepDisableAllChecks to speed build up a little. We want to be able to enable checks for certain targets but providing extra javacopt value.

As of now there are plenty of settings that disabling certain parts of EP yet there is no way to negate those disablements if we want to do this on target level.

            default_java_toolchain(
                name = "javac_toolchain_%d" % (release),
                configuration = DEFAULT_TOOLCHAIN_CONFIGURATION,
                source_version = "%s" % release,
                target_version = "%s" % release,
                package_configuration = [
                    ":disable_warnings",
                    ":parameters_for_spring",
                    ":debug",
                ],
                java_runtime = Label("...."),
                jvm_opts = BASE_JDK9_JVM_OPTS + ["-Xss4m", "-XX:-MaxFDLimit"],
                javacopts = DEFAULT_JAVACOPTS,
                visibility = ["//visibility:public"],
            )

        disable_warning_javac_opts = [
            "-Xlint:none",
            "-nowarn",
            "-XepDisableWarningsInGeneratedCode",
        ]
        if no_error_prone:
            disable_warning_javac_opts += ["-XepDisableAllChecks"]
        java_package_configuration(
            name = "disable_warnings",
            javacopts = disable_warning_javac_opts,
            packages = ["...:all_packages"],
        )

dkashyn-sfdc avatar Jul 17 '24 00:07 dkashyn-sfdc