| Important Once rules have been added to extensions/rules, they should be enabled in the relevant quality profile in Sonar. Only after this has been done, the analysis can be performed |
Extend Coding Rules - Extensions/Rules
From version 0.2, its possible to extend the rules available in quality profiles for any sensor. To do this a directory with tool name and a xml with the description of the rules should be provided. For example
- [Sonar Server Install Dir]\extensions\rules\cppcheck for cpp check sensor
Rules XML Format
| Xml Description | Example |
|---|---|
<rules> | <?xml version="1.0" encoding="UTF-8" standalone="yes"?> |
| Attributes | Description |
| key [RULE_ID] | Id of the rule, should match the id in the external reports |
| name | Can be really anything, in the quality profile in sonar its the first name that is displayed per rule |
| configKey | This key is used later by the sensor to configure the code analyzer (Extending+Coding+Rules ) |
| category name | Can be anything, examples include Maintainability Style Usability etc |
| description | In the quality profile in sonar ui, the description will be show after expanding each rule |

