3

We are working with VS2012+TFS2012 and I wanted to add code analysis check-in policy to remind every team members to fix code warnings before checking-in, but then I noticed it forces us to check "activate code analysis on build" project option.

We are also doing TDD, so it means we code a unit test, run it (which means build the project) to confirm the test fails, we code to make the test passes, then we run the test again to confirm it passes.

So for 1 unit test we have to build twice (minimum, sometimes more if we do some coding error), but because code analysis takes more than 10 sec to run on every build this is very very unproductive :(

Is it possible to enforce running code analysis only before check-in, not on every build ?

Jonathan
  • 1,276
  • 10
  • 35

1 Answers1

1

Well, if you used Git, you could create a Pull Request branch, do your TDD on that branch, and then, before sending the Pull Request, fix all the Code Analysis errors - and then push all the commits that you've built up, including the commit(s) that address the Code Analysis warnings.

That's how I often combine the two, and it works great.

If TFS doesn't let you work like this, it's just yet another example of how TFS kills productivity.

Mark Seemann
  • 225,310
  • 48
  • 427
  • 736