Use OperatingSystem methods instead of RuntimeInformation
Recipe ID
OpenRewrite.Recipes.CSharp.CodeQuality.Style.FindUseOperatingSystemMethodsArtifactOpenRewrite.Recipes.CSharp.CodeQualityUse OperatingSystem.IsWindows() and similar methods instead of RuntimeInformation.IsOSPlatform(). The OperatingSystem methods are more concise and can be optimized by the JIT.
Single recipecsharpstylecode-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.FindUseOperatingSystemMethodsIf the recipe isn’t available locally, install it with:
mod config recipes nuget install OpenRewrite.Recipes.CSharp.CodeQuality