This topic explains how to create and customize a Coding Standards tool that verifies whether code follows a user-defined set of custom rules and/or built-in rules.
Sections include:
Understanding Coding Standards
The Coding Standards tool verifies whether your code follows rules that verify anything from W3C guidelines for a specific language, to team naming standards, to project-specific design requirements, to the proper usage of custom XML tags.
When you create a new Coding Standards instance, you can configure it to check any number or combination of custom rules and built-in rules. Custom rules can verify application-specific design and content requirements, enforce custom coding standards, enforce naming conventions, identify text (such as an exception message) that signals a problem, query XML data, or even perform custom file transformations.
You create custom rules in RuleWizard, which can automatically generate rules or help you create them graphically. For details on designing custom rules, see the RuleWizard User’s Guide (go to Help > RuleWizard Documentation from the RuleWizard GUI).
Typically, users create a custom Coding Standards tool to check a logical group of custom rules. For example, if a team implemented rules that check project-specific design guidelines, rules that check team naming guidelines, and rules that check for each team member’s most common coding mistakes, they might want to create three separate Coding Standards tools, one for each logical group of rules.
Configuring Coding Standards
You configure the Coding Standards tool by specifying which rules you want it to check. In the configuration panel, you can:
- Enable/disable individual rules or groups of rules by enabling or disabling the available options.
- Customize a parameterizable rule by right-clicking it and choosing View/Change Rule Parameters. Parameterized rules are marked with a special icon (a wizard hat with a radio button):
- Search for a rule by clicking Find, then using that dialog to search for the rule.
- Hide the rules that are not enabled by clicking Hide Disabled. If you later want all rules displayed, click Show All.
- View a description of a rule by right-clicking the node that represents that rule and choosing View Rule Documentation.