Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which StyleCop package to use

I am going to introduce StyleCop to my C# project, and there seems to be a multitude of ways of doing this. Checking NuGet I can see StyleCopPlus.MSBuild (seems not to be actively developed), StyleCop, StyleCop.Analyzers that all seem to introduce StyleCop to a project. There is also a StyleCop Visual Studio Extension and a StyleCop extension to Resharper.

Is there a recommended way of doing this? A good solution should be actively developed and support new language features.

like image 677
Petter T Avatar asked Mar 06 '23 17:03

Petter T


1 Answers

TLDR: If not using Resharper, there is only one alternative: StyleCopAnalyzers. If using Resharper: stick with that also for Stylecop.

  1. NuGet - StyleCopPlus.MSBuild: Not actively developed, not updated since 2014.
  2. Nuget - Stylecop: Says on their project page that "While pull requests will continue to be accepted, it is unlikely that any major development will be done on this project. The Roslyn-based StyleCopAnalyzers project is recommended for developers who use only Visual Studio 2015 or later"
  3. Nuget - StyleCopAnalyzers: Actively developed, the latest update (beta version) was only one month ago. More than 3M downloads on nuget, this is more than 10 times the other two nuget packages above
  4. Visual studio extension: This is actually the same project as the Stylecop nuget package (2). That recommends StyleCopAnalyzers
  5. Resharper extension: This is based on the same github repo as 2. If you are using Resharper, it would be a good idea to use the Resharper extension. Otherwise you will run into situations where applying fix for one rule will break some other.
like image 157
Petter T Avatar answered Mar 15 '23 09:03

Petter T