创建编码标准
R2026b将现有检查项打包为可分享的用户定义编码标准
通过选择强制执行工程规范的现有 Polyspace® Bug Finder™ 检查项,创建用户定义的编码标准。将这些检查项整理成规则和章节,然后将它们打包为一个检查项激活文件 (.pschk)。
运行 polyspace-query-language init 以创建工程模板,然后定义规则和章节:
catalog ProjectSafety = {
Memory.Memory,
ClassDesign.ClassDesign
}
section Memory = { MEM_1, MEM_2 }
rule MEM_1 = { std.cert_cpp.MEM52_CPP }
rule MEM_2 = { std.misra_c_2012.R21_3 }主题
- Create User-Defined Coding Standard from Existing Checkers
Bundle existing Polyspace Bug Finder checkers into a shareable coding standard (
.pschk) file using Polyspace Query Language. - Find Polyspace Bug Finder Checkers That Map to Coding Rules in User-Defined Coding Standard
Find Bug Finder checkers that can check for the coding rules in your user-defined coding rule standard.
- Check for Violations of User-Defined Coding Standard Using Polyspace Bug Finder
Run Bug Finder analyses to check for violations of user-defined coding standards. Review and address results in the Polyspace Platform user interface.
- Best Practices for Creating User-Defined Coding Standards
Organize user-defined coding standards in modular packages for easier maintenance.