Naming Conventions
- 2 minutes to read
With CodeRush, you can define naming standards for each type of identifier. They will automatically apply to your code while using refactorings and code providers. Also, the code parts that do not follow naming conventions can be treated as code issues (Analyzer ID is CRR1000).
Configuration
Naming conventions are configured in the Editor | <Language> | Naming Conventions options page.
You can configure naming conventions for any identifier kind. A convention includes prefix, suffix, capitalization type and separation type.
NOTE
To define the snake_case naming rule, select "all lower" in the Capitalizing menu and "With Underscopes" in Separator Options.
Usage
Naming conventions are applied on code generation (Refactorings, Code Providers and Code Templates) and referenced on Static Code Analysis (in the "The name does not correspond to naming conventions" analyzer).
There are two types of naming rules: main and additional. Code generation features refer to the main rule only, whereas the static code analysis uses both main and additional rules. In other words, the new code is generated according to the main rule, and the additional rules are used (along with the main rule) to define what naming options should not be treated as code issues.