Predefined EditorConfig and rule set files are available that make it quick and easy to enable a category of code quality rules, such as security or design rules. By enabling a specific category of rules, you can identify targeted issues and specific conditions. To access these predefined files, install the Microsoft.CodeAnalysis.NetAnalyzers NuGet analyzer package.
Each of those categories of rules has an EditorConfig or rule set file to:
Enable all the rules in the category (and disable all other rules)
Use each rule's default severity and enabled by default setting (and disable all other rules)
Savjet
The "all rules" category has an additional EditorConfig or rule set file to disable all rules. Use this file to quickly get rid of any analyzer warnings or errors in a project.
Predefined EditorConfig files
The predefined EditorConfig files for the Microsoft.CodeAnalysis.NetAnalyzers analyzer package are located in the editorconfig subdirectory of where the NuGet package was installed. For example, the EditorConfig file to enable all security rules is located at editorconfig/SecurityRulesEnabled/.editorconfig.
Copy the chosen .editorconfig file to your project's root directory.
Predefined rule sets
The predefined rule set files for the Microsoft.CodeAnalysis.NetAnalyzers analyzer package are located in the rulesets subdirectory of where the NuGet package was installed. For example, the rule set file to enable all security rules is located at rulesets/SecurityRulesEnabled.ruleset. Copy one or more of the rule sets and paste them in the directory that contains your project.
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.