Each code analysis rule belongs to a category of rules. For example, design rules support adherence to the .NET design guidelines, and security rules help prevent security flaws. You can configure the severity level for an entire category of rules. You can also configure additional options on a per-category basis.
The following table shows the different code analysis rule categories and provides a link to the rules in each category. It also lists the configuration value to use in an EditorConfig file to bulk-configure rule severity on a per-category basis. For example, to set the severity of security rule violations to be errors, the EditorConfig entry is dotnet_analyzer_diagnostic.category-Security.severity = error.
Savjet
Setting the severity for a category of rules using the dotnet_analyzer_diagnostic.category-<category>.severity syntax doesn't apply to rules that are disabled by default. However, starting in .NET 6, you can use the AnalysisMode<Category> project property to enable all the rules in a category.
* Use the EditorConfig value dotnet_analyzer_diagnostic.category-CodeQuality.severity to enable the following rules: IDE0051, IDE0052, IDE0064, and IDE0076. While these rules start with "IDE", they aren't technically part of the Style category.
Izvor za ovaj sadržaj možete pronaći na GitHubu, gdje možete stvarati i pregledavati probleme i zahtjeve za povlačenjem. Dodatne informacije potražite u našem vodiču za suradnike.
Povratne informacije o proizvodu .NET
.NET je projekt otvorenog koda. Odaberite vezu za slanje povratnih informacija:
Pridružite se seriji susreta kako biste s kolegama programerima i stručnjacima izgradili skalabilna rješenja umjetne inteligencije temeljena na stvarnim slučajevima upotrebe.