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