禁用容易出错的bazel [英] Disable error prone in bazel
问题描述
我有一个包含很多代码的项目.某些代码无法通过Bazel中默认情况下启用的容易出错的检查.我想在bazel中禁用容易出错的功能.无需通过WORKSPACE文件添加命令行参数就可以做到吗?
I have a project with a lot of code. Some of this code doesn't pass error-prone inspections turned on by default in Bazel. I want to disable error-prone in bazel. Is it possible to do it without adding a command line argument via the WORKSPACE file?
P.S.通过命令行禁用效果很好
P.S. Disabling via command line works well
推荐答案
正如Xiao Liang所说,您可以将--javacopt="-XepDisableAllChecks"
添加到bazelrc
中,也可以将其添加到工作区中的tools/bazel.rc
中,以便它可以使用源代码签入.请注意,尽管这将禁用工作区中所有Java构建的易于出错的功能.您可以改为使用 java_binary.javacopts 或 java_library.javacopts 为特定的二进制文件或库禁用容易出错的代码,这会使错误易于在构建的其他部分上运行.
As Xiao Liang mentioned, you can add --javacopt="-XepDisableAllChecks"
to your bazelrc
, or you can also add it to tools/bazel.rc
inside your workspace so that it can be checked in with the source code. Note though that this will disable error prone for all java builds in the workspace. You can instead use java_binary.javacopts or java_library.javacopts to disable error prone for specific binaries or libraries, which would allow error prone to run on other parts of the build.
这篇关于禁用容易出错的bazel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!