DotNetAnalyzers / StyleCopAnalyzers

An implementation of StyleCop rules using the .NET Compiler Platform
MIT License
2.64k stars 508 forks source link

[Question] Is it possible to run StyleCopAnalyzers as part of VSTS build system? #2544

Open Gorthog opened 6 years ago

Gorthog commented 6 years ago

I would like to make sure that even if some dev forgot to include StyleCopAnalyzers nuget package in csproj, gated build will still fail with all stylecop related errors. Is this possible?

sharwell commented 6 years ago

Removing the NuGet package is equivalent to disabling StyleCop Analyzers for the project. It may be possible to have a check that requires the NuGet package be installed, but naturally that check would not be part of StyleCop Analyzers itself.

💭 dotnet/roslyn has a "BuildBoss" tool which validates the solution and project structure on various aspects. I'm not exactly sure how it works or how it's integrated, but a solution similar to that may be what you're after.