Error-Prone Command-line flags
来源:互联网 发布:软件项目任务模版 编辑:程序博客网 时间:2024/05/22 00:11
命令行标志
Error Prone允许用户启用和禁用特定的检查,并通过将选项传递给Error Prone编译器调用来覆盖其内置的严重性级别(警告与错误)。
有效的Error Prone命令行选项如下所示:
-Xep:<checkName>[:severity]
checkName
是必需的,是check的规范名称,例如“ReferenceEquality”。severity
是{“OFF”,“WARN”,“ERROR”}之一。必须传递多个标志才能启用或禁用多个检查。特定检查的最后一个标志胜出。
使用示例如下:
-Xep:ReferenceEquality [开启ReferenceEquality检查并使用它的BugPattern标注的严重级别]-Xep:ReferenceEquality:OFF [关闭ReferenceEquality检查]-Xep:ReferenceEquality:WARN [开启ReferenceEquality检查并作为警告]-Xep:ReferenceEquality:ERROR [开启ReferenceEquality检查并作为错误]-Xep:ReferenceEquality:OFF -Xep:ReferenceEquality [开启ReferenceEquality检查]
如果您传递一个引用未知检查名称的标志,默认情况下Error Prone会抛出错误。您可以通过传递-XepIgnoreUnknownCheckNames
标志来允许使用未知的检查名称。
Maven
要将Error Prone标志传递给Maven,请使用插件配置中的compilerArgs
参数。要启用警告,也必须设置showWarnings
参数:
<project> <build> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <compilerId>javac-with-errorprone</compilerId> <showWarnings>true</showWarnings> <compilerArgs> <arg>-Xep:DeadException:WARN</arg> <arg>-Xep:GuardedBy:OFF</arg> </compilerArgs> </configuration> </build> </plugins> </plugin></project>
参考链接: command-line flags
0 0
- Error-Prone Command-line flags
- Command-Line Flags
- Error Prone Installation
- Error-Prone Plugin checks
- Error-Prone Patching
- Error-Prone Refaster templates
- command line option syntax error
- command line option syntax error
- Contribute checker for error-prone
- 遇到cl : Command line error D8036 错误
- openssl error: unrecognized command line option "-m486"
- Command line option syntax error错误解决方案
- Command line option syntax error错误解决办法
- ERROR at line 206: Unknown command '\''.解决办法
- error: unrecognized command line option "-fconserve-stack"
- cc1: error: unrecognized command line option "-m64"
- 【IDE-Visual Studio】Command line error D8016
- VisualGDB : error : Command-line action failed
- nginx学习文档之一 安装nginx-Windos下安装nginx
- 一切皆对象
- 数据库发展简史
- python学习笔记2:“=”的真正含义——引用
- Qt-为应用程序添加logo
- Error-Prone Command-line flags
- oracle 创建簇
- 操作符
- matlab -xlsread 打开xls文件出错:服务器出现意外情况
- PL/SQL
- Android Notification 详解——基本操作
- ORACLE 数据库操作语言
- Qt
- Android Notification 详解(一)——基本操作