This repository contains a static code analysis rule set used by Kentico projects. The rule set aggregates various code analysis libraries and rules to one reusable NuGet package.
If you're new to static code analysis, take a look at this video.
Install this NuGet package as a dependency. This automatically adds references to the code analyzer libraries and downloads the rule set file into the project root folder.
Install-Package Kentico.CodeAnalysis.Ruleset
Then, in your project properties > code analysis > select the newly downloaded rule set.
After a successful installation, set the RunCodeAnalysis
parameter in MSBuild
to true and you're good to go.
MSBuild MySolution.sln /p:RunCodeAnalysis=true
- automatic updates of dependencies to Code Analyzer libraries
- automatic updates of the rule set file
- reusability of the same rule set in different projects/solutions
- Microsoft.AnalyzerPowerPack.Common
⚠️ CA1715: Identifiers should have correct prefix.