Use block body or expression body
Recipe ID
OpenRewrite.Recipes.CSharp.CodeQuality.Style.UseBlockBodyOrExpressionBodyArtifactOpenRewrite.Recipes.CSharp.CodeQualityConvert between block body and expression body for members.
Single recipecsharpcode-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.Style.UseBlockBodyOrExpressionBodyIf the recipe isn’t available locally, install it with:
mod config recipes nuget install OpenRewrite.Recipes.CSharp.CodeQualityOptions
| Name | Type | Description |
|---|---|---|
AllowMultiLine | Boolean | When true, also flags methods with multi-line return expressions (e.g., switch expressions, multi-line conditionals). Default is false, matching Roslyn's default RCS1016 behavior. |