dennisdoomen / CSharpGuidelines

A set of coding guidelines for C# 9.0, design principles and layout rules for improving the overall quality of your code development.
https://www.csharpcodingguidelines.com
Other
745 stars 272 forks source link

Consider removing FxCop references #170

Closed bkoelman closed 6 years ago

bkoelman commented 6 years ago

A while ago some FxCop-related text was removed from recent releases. The following is still in, but may need to be considered for removal as well:

Intro 1.4

  • Decide which CA rules are applicable for your project and store these somewhere, such as your source control system, or create a custom Visual Studio Rule Set.
  • Add a custom Code Analysis Dictionary containing your domain or company-specific terms, names and concepts. If you don't, Static Analysis will report warnings for (parts of) phrases that are not in its internal dictionary.
  • Configure Visual Studio to verify the selected CA rules as part of the Release build. Then they won't interfere with normal developing and debugging activities, but still can be run by switching to the Release configuration.
  • Add an item to your project checklist to make sure all new code is verified against CA violations, or use something like Check-in Policy or a Git commit hook to prevent any code from violating CA rules at all.

AV1701

Exception: In most projects, you will use words and phrases from your domain and names specific to your company. Visual Studio's Static Code Analysis performs a spelling check on all code, so you may need to add those terms to a Custom Code Analysis Dictionary.

Cheatsheet

These coding guidelines are an extension to Visual Studio's Code Analysis functionalty, so make sure you enable that for all your projects. Check the full document for more details.