C#-CSharpNamingConvention¶
Naming conventions for C#
Required inputs: CSharpAST
Possible Messages
This rule has no predefined messages.
Options¶
This rule shares the following common options: excludes, includes, justification_checker, post_processing, provider, severity
The following places define options that affect this rule: Stylechecks, Analysis-GlobalOptions
naming¶
naming
Map entity -> naming convention.Type: bauhaus.rules.csharp.csharp_naming.CSharpNamingConvention
Default:
{ 'BaseNamespaceDeclarationSyntax': [('^[A-Z][A-Za-z0-9]*$', 'Namespace must use Pascal casing')], 'CatchDeclarationSyntax': [('^([a-z][A-Za-z0-9]*|_+)$', 'Exception variable must use Camel casing')], 'ClassDeclarationSyntax': [('^[A-Z][A-Za-z0-9]*$', 'Class must use Pascal casing')], 'DelegateDeclarationSyntax': [('^[A-Z][A-Za-z0-9]*$', 'Delegate must use Pascal casing')], 'EnumDeclarationSyntax': [('^[A-Z][A-Za-z0-9]*$', 'Enumeration type must use Pascal casing')], 'EnumMemberDeclarationSyntax': [('^[A-Z][A-Za-z0-9]*$', 'Enumerator must use Pascal casing')], 'EventDeclarationSyntax': [('^[A-Z][A-Za-z0-9]*$', 'Event must use Pascal casing')], 'ForEachStatementSyntax': [('^([a-z][A-Za-z0-9]*|_+)$', 'Foreach variable must use Camel casing')], 'InterfaceDeclarationSyntax': [('^I[A-Z][A-Za-z0-9]*$', 'Interface must use Pascal casing and has to start with "I"')], 'MethodDeclarationSyntax': [('^[A-Z][A-Za-z0-9]*$', 'Methods must use Pascal casing')], 'ParameterSyntax': [(<function bauhaus.rules.axivion.style.naming.naming_convention.checker(name: str, node: 'CSharpSyntaxNode', symbol: 'ISymbol', context: 'ICSharpObjectModel') -> Union[bool, Match[str], NoneType]>, 'Parameter of record primary constructor must use Pascal casing'), ('^([a-z][A-Za-z0-9]*|_+)$', 'Parameter must use Camel casing')], 'PropertyDeclarationSyntax': [('^[A-Z][A-Za-z0-9]*$', 'Property must use Pascal casing')], 'RecordDeclarationSyntax': [('^[A-Z][A-Za-z0-9]*$', 'Record must use Pascal casing')], 'SingleVariableDesignationSyntax': [('^([a-z][A-Za-z0-9]*|_+)$', 'Local variable must use Camel casing')], 'StructDeclarationSyntax': [('^[A-Z][A-Za-z0-9]*$', 'Struct must use Pascal casing')], 'VariableDeclaratorSyntax': [(<function bauhaus.rules.axivion.style.naming.naming_convention.checker(name: str, node: 'CSharpSyntaxNode', symbol: 'ISymbol', context: 'ICSharpObjectModel') -> Union[bool, Match[str], NoneType]>, 'Event must use Pascal casing'), (<function bauhaus.rules.axivion.style.naming.naming_convention.checker(name: str, node: 'CSharpSyntaxNode', symbol: 'ISymbol', context: 'ICSharpObjectModel') -> Union[bool, Match[str], NoneType]>, 'Instance fields that are not private must use Pascal casing'), (<function bauhaus.rules.axivion.style.naming.naming_convention.checker(name: str, node: 'CSharpSyntaxNode', symbol: 'ISymbol', context: 'ICSharpObjectModel') -> Union[bool, Match[str], NoneType]>, 'Static fields that are not private must use Pascal casing'), (<function bauhaus.rules.axivion.style.naming.naming_convention.checker(name: str, node: 'CSharpSyntaxNode', symbol: 'ISymbol', context: 'ICSharpObjectModel') -> Union[bool, Match[str], NoneType]>, 'Instance fields that are private must use Camel casing'), (<function bauhaus.rules.axivion.style.naming.naming_convention.checker(name: str, node: 'CSharpSyntaxNode', symbol: 'ISymbol', context: 'ICSharpObjectModel') -> Union[bool, Match[str], NoneType]>, 'Static fields that are private must use Camel casing'), ('^([a-z][A-Za-z0-9]*|_+)$', 'Local variable must use Camel casing')] }