Enforce good naming behavior in fields and properties
See original GitHub issueMake sure that fields, properties and events are properly named.
First, make sure that they’re not defined with a single character but also, that they respect the camelCase such as fields are to respect lowerCamelCase and properties are to respect UpperCamelCase.
Warning level : Info
Diagnostics : CC0016
As for test cases, this is straightfoward. The analyzer will verify FieldDeclarationSyntax, EventDeclarationSyntax, PropertyDeclarationSyntax and evaluate their ISymbol to find out their name. Then, a simple Regex for each of those syntax will either validate or invalidate the name that was retrieved within the ISymbol.
Basically, there would be six test case: one good and one bad foreach of the SyntaxNode that the analyzer has to evaluate. @giggio
Issue Analytics
- State:
- Created 8 years ago
- Comments:9 (5 by maintainers)
And about sugest lowdash/underscore (‘_’) prefix for private fields?
@thiagolunardi I agree with you.