- Roslyn Cookbook
- Manish Vasani
- 193字
- 2025-02-28 17:12:56
How it works...
The ruleset file is essentially a grouping of a set of code-analysis rules that you can apply to a project to configure it's analysis. It is specified in an XML format and is based on an XML schema that ships with Visual Studio. It is also open sourced, and can be found at https://github.com/dotnet/roslyn/blob/version-2.0.0/src/Compilers/Core/Portable/RuleSet/RuleSetSchema.xsd. A ruleset can be specified for a project using the CodeAnalysisRuleset property in the project file. Each Rules node contains a collection of rule specifications with a common analyzer ID and namespace. Each Rule specification has the rule ID and the effective Action or the severity. The rule Action can take one of the following five values: None (suppressed), Hidden (non-visible in the IDE, primarily a code fix trigger), Info (informational message), Warning, and Error. These rule actions get converted into compilation options for the compiler and override the default severity of the diagnostic ID.
The Rule Set editor is a powerful graphical user interface to search, filter, and bulk-edit rule configurations.