TFS Check-In Policy for Roslyn-Analyzer Warnings

634 Views Asked by At

We recently switched to Visual Studio 2015 and now want to make use of the new Roslyn-Analyzer feature. In fact we want to replace the "legacy" StyleCop with the newer StyleCop Analyzers (https://github.com/DotNetAnalyzers/StyleCopAnalyzers). In VS2013 we had a custom Check-In policy which ran StyleCop and prevented a Check-In if there were any violations. Can something similar be achieved with the Roslyn-Analyzers as well? Is it supported "out of the box" or do we have to write a custom check-in policy as well?

2

There are 2 best solutions below

2
Eddie Chen - MSFT On

You have to create a custom check-in policy to achieve it.

0
huserben On

I tried lately again to tackle this issue and realized that Microsoft apparently changed their previous Code Analysis Check-In policy to work with the new Roslyn Analyzer warnings (tried via my Visual Studio Team Services TFS). It checks only files that are in the "Include" section and forces you to have an actual build of the files you want to check in and blocks check-in's if you have any warning.