views:

433

answers:

2

Is there any way to create a custom TFS check-in policy that can jump through each node within the code being checked in for code standards we have defined?

+1  A: 

Take a look at this particular screencast. It's a very good place to start.

You might also want to take a look at the StyleCop CodePlex project which deal with stuffs like coding standard and formatting.

The combination of the two might yield you what you want.

Here is another resource if you like reading instead of watching.

Jimmy Chandra
A: 

You don't need a separate check-in policy for that. Use the policy that requires that the code be built. Configure the solution to require code analysis, and set the rules so that the most important rules cause errors when they're violated.

When the rules are violated, the code won't build, and since the code won't build, you can't check it in.

John Saunders