本插件致力于守护开发人员代码质量,成为开发人员的助手和利器。秉承极简、极速、即时看护的理念,提供业界规范(含华为云)的检查、代码风格一键格式化及代码自动修复功能。
当前支持语言:Java,C,C++,Python。
当前有3个需要注意的事项:
需要您这边使用华为云账号信息登录之后,才可以解锁插件配置界面。(注:不会影响插件其他功能的使用)
插件会在每次打开CodeArts IDE的时候,对本地的资源包版本和线上环境里资源包的版本做校验;如果本地资源包版本低于线上最新版本,插件会对资源包进行自动更新。
2.1 用户无需担心自动更新,插件会处理下载过程并告知用户更新的开始、进度与结束。
2.2 用户也无需担心断网环境下插件无法使用的情况,插件保障断网环境下功能仍可正常使用。
在当前打开的文件代码编辑区,点击鼠标右键,选择“CodeArts Check文件检查”:
或者 在项目的资源管理器界面里,鼠标移动到需要扫描的文件,点击鼠标右键,选择“CodeArts Check文件检查”:
在项目的资源管理器里,按住ctrl键,鼠标左键选择需要扫描的几个文件;选择完毕之后,点击鼠标右键,选择“CodeArts Check文件检查”:
在当前打开的文件代码编辑区,点击鼠标右键,选择“CodeArts Check项目检查”:
或者 在项目的资源管理器界面里,点击鼠标右键,选择“CodeArts Check项目检查”:
在当前打开的文件代码编辑区,点击鼠标右键,选择“CodeArts Check增量检查”(前提:当前打开的是标准的git工程):
或者 在项目的资源管理器界面里,点击鼠标右键,选择“CodeArts Check增量检查”(前提:当前打开的是标准的git工程):
可以按告警类型、严重级别、规范规则、文件分类筛选查看;告警帮助提供告警详细描述、严重级别、告警类型、正确示例、错误示例及修复建议。
鼠标移动到检查结果区域,会有四个按钮浮现,点击第一个“分类'按钮,根据需要选择”严重程度/文件分类/规则分类”来进行查看:
鼠标移动到检查结果区域,会有四个按钮浮现,点击第二个“筛选'按钮,根据需要来选择显示问题的方式:
支持直接点击一键格式化选项。支持对单文件/多文件/文件夹/整个项目进行一键格式化。
一键格式化选项帮助用户自动解决项目里基础的代码风格问题-比如多余的空格或者额外的空行。
在当前打开的文件代码编辑区或者在项目的资源管理器界面里,点击鼠标右键,选择“CodeArts Check一键格式化”(插件里的工具会先去做格式化操作,然后再对当前文件进行“CodeArts Check检查”):
针对插件扫描出来的单个问题,插件提供建议如何修复的预览界面及自动修复按钮,用户可以选择此按钮,插件会进行自动修复:
打开左侧DevOps,展开CodeArts Check插件下的配置,点击“您尚未登录,请先登录”后跳转到华为云平台,然后使用华为云账号登录,登录成功后点击“CodeArts Check配置”查看配置:
支持无感扫描(扫描完成不影响用户当前作业窗口,修改保存自动扫描、结果自动刷新在问题窗口和CodeArts Check窗口),该功能可以在配置界面手动关闭:
支持写相对代码仓的相对目录,例如:一级目录写 目录名,二级目录写 目录1名/目录2名;多个指定目录扫描,可用;号隔开,不填默认扫描整个项目的所有内容(仅在项目检查时生效):
支持规则的搜索或过滤:
支持规则的快速勾选/取消勾选:
支持规则端对端导入:
支持导出已应用激活的规则:
The plug-in is a powerful assistant for developers to protect the code quality. It provides industry standard check, one-click code style formatting, and automatic code fixing, adhering to the concepts of simplicity, high speed, and real-time monitoring. Currently, it supports Java, C, C++, Python.
There are 2 things to look out:
To configure the plug-in, log in to the plug-in using your Huawei Cloud account. (Note: Other functions of the plug-in can be used without login).
The plug-in verifies both the local and online resource package versions during open the window. If the local version is outdated, the plug-in will automatically update it.
In the editor area, right-click and click "File Check with CodeArts Check":
Alternatively, in the Project window, right-click the file to be checked and click "File Check with CodeArts Check":
In the Project window, hold down Ctrl and select multiple files. Then, right-click and click "File Check with CodeArts Check":
In the editor area, right-click and click "Project Check with CodeArts Check":
Alternatively, in the Project window, right-click the file and click "Project Check with CodeArts Check":
In the editor area, right-click and click "Incremental Check with CodeArts Check" (Prerequisite: A standard git project is opened):
Alternatively, in the Project window, right-click the file and click "Incremental Check with CodeArts Check" (Prerequisite: A standard git project is opened):
Viewing defect details, severity, type, compliant example, non-compliant example, and fixing suggestion by severity, rule, file, and defect type.
In the Defects area, click the first button on the left, and viewing defects by severity, rule, and file to view details:
In the Defects area, click the second button on the left, and filter defects as needed:
Easily format one file, multiple files, a folder, or an entire project with just one click.
With one-click formatting, you can easily resolve common code specification issues in your project, such as extra spaces or blank lines.
In the editor area or in the Project window, right-click and click "Auto Format with CodeArts Check". Then, the plug-in formats the file and checks the current file:
The plug-in provides a preview window with fix suggestions and the automatic fix function:
Open the devOps on the left and expand CodeArts Check, click "You are not logged in, please log in first", go to the Huawei Cloud platform and use a Huawei Cloud account to log in. After the login is successful, click "CodeArts Check Configuration" to view the configuration:
Automatic check does not affect the current window. Once you modify and save the code, the latest check results will be automatically updated in the Defects window and the CodeArts Check window. This function can be manually disabled on the configuration page:
Specify multiple directories by separating them with commas (,). To check the dir1 directory, enter dir1. To check dir2 in the dir1 directory, enter dir1/dir2. If no directory is specified, all content of the entire project is checked by default. (This parameter is valid only during "Project Check with CodeArts Check" is used):
Search for or filter rules:
Enable or disable rules:
End-to-End import rules:
Exporting rules that have been applied and activated: