26.04.2015 Views

Team Development with Visual Studio Team Foundation Server

Team Development with Visual Studio Team Foundation Server

Team Development with Visual Studio Team Foundation Server

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Check-in Policies<br />

• How to set up check-in policies to enforce code quality<br />

• How to set up check-in policies to ensure that developers associate work items<br />

<strong>with</strong> check-ins<br />

• How to set up check-in policies to enforce coding standards<br />

How to Set Up Check-in Policies to Enforce Code Quality<br />

Use a combination of code analysis and testing policies to enforce a standard of code<br />

quality. For example, use the testing policy available out-of-box <strong>with</strong> VSTS, to ensure<br />

that specific tests are executed and passed prior to allowing source to be checked into<br />

Microsoft® <strong>Visual</strong> <strong>Studio</strong>® 2005 <strong>Team</strong> <strong>Foundation</strong> <strong>Server</strong> (TFS) source control. You<br />

can also configure a code analysis policy to help ensure that your code meets certain<br />

quality standards by ensuring that security, performance, portability, maintainability, and<br />

reliability rules are passed.<br />

By enforcing this type of check-in policy in addition to policies that enforce coding<br />

standards and guidelines, you ensure that your code meets a specific code quality gate.<br />

To enforce a code analysis check-in policy for a team project<br />

1. In <strong>Team</strong> Explorer, right-click your team project, point to <strong>Team</strong> Project Settings, and<br />

then click Source Control.<br />

2. Click the Check-in Policy tab.<br />

3. Click Add and then select and configure the appropriate policy.<br />

Additional Resources<br />

• For more information about creating and using a custom check-in policy, see “How<br />

To – Step Through Creating Custom Check-in Policies for TFS” In this guide.<br />

• To learn how to customize a check-in policy, see “Walkthrough: Customizing Checkin<br />

Policies and Notes” at http://msdn2.microsoft.com/enus/library/ms181281(VS.80).aspx<br />

• To view sample code that will disallow selected patterns on check-in, see “Checkin<br />

Policy to Disallow Certain Patterns” at<br />

http://blogs.msdn.com/jmanning/archive/2006/02/02/523125.aspx<br />

• To see sample code that will enforce comments on check-in, see “Sample Checkin<br />

Policy: Make Sure the Comment Isn’t Empty” at<br />

http://blogs.msdn.com/jmanning/archive/2006/01/21/515858.aspx<br />

• To learn how to register a new check-in policy, see “I’ve Made a New Check-In<br />

Policy! How Do I Add It?” at<br />

http://blogs.msdn.com/jmanning/archive/2006/02/07/526778.aspx

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!