Check-in policies are a great tool to enforce quality code before it hits your source control repository. SSW recommends that the following check-in policies be enabled by default on your project:
Changeset Comments Policy - To enforce that all check-in contain comments
SSW Code Auditor - To enforce coding standards and best practices before check-in
Testing Policy - To enforce that unit tests should all pass before code can be checked-in
Code Analysis Policy – To enforce that code analysis rules are not broken
Builds Policy – To enforce that the developer has built the project end to end before they check-in
More Information
To enable these policies:
Right click the Team Project in Team Explorer > Team Project Settings > Source Control
Select the check-in policies above
Click OK
Figure: Chose check-in policies in TFS