Naming code quality
Recipe ID
OpenRewrite.Recipes.CSharp.CodeQuality.Naming.NamingCodeQualityArtifactOpenRewrite.Recipes.CSharp.CodeQualityNaming convention recipes for C# code.
Composite recipecsharpnamingcode-qualityProprietary
Usage
This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.
mod run . --recipe OpenRewrite.Recipes.CSharp.CodeQuality.Naming.NamingCodeQualityIf the recipe isn’t available locally, install it with:
mod config recipes nuget install OpenRewrite.Recipes.CSharp.CodeQualityDefinition
This recipe runs the following recipes in order.
- Async method name should end with Async
OpenRewrite.Recipes.CSharp.CodeQuality.Naming.AsyncMethodNameShouldEndWithAsync - Non-async method should not end with Async
OpenRewrite.Recipes.CSharp.CodeQuality.Naming.NonAsyncMethodNameShouldNotEndWithAsync - Use nameof operator
OpenRewrite.Recipes.CSharp.CodeQuality.Naming.UseNameofOperator - Rename private field according to _camelCase convention
OpenRewrite.Recipes.CSharp.CodeQuality.Naming.RenamePrivateFieldAccordingToConvention - Rename parameter to camelCase
OpenRewrite.Recipes.CSharp.CodeQuality.Naming.RenameParameterAccordingToConvention - Parameter name should match base definition
OpenRewrite.Recipes.CSharp.CodeQuality.Naming.ParameterNameMatchesBase - Attribute name should end with 'Attribute'
OpenRewrite.Recipes.CSharp.CodeQuality.Naming.FindAttributeNameShouldEndWithAttribute - Exception name should end with 'Exception'
OpenRewrite.Recipes.CSharp.CodeQuality.Naming.FindExceptionNameShouldEndWithException - EventArgs name should end with 'EventArgs'
OpenRewrite.Recipes.CSharp.CodeQuality.Naming.FindEventArgsNameConvention - Find TODO/HACK/FIXME comments
OpenRewrite.Recipes.CSharp.CodeQuality.Naming.FindFixTodoComment