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.

How to Set Up Check-in Policies to Ensure That Developers Associate<br />

Work Items <strong>with</strong> Check-ins<br />

Configure the out-of-box Work Item check-in policy, so that developers are forced to<br />

associate work items <strong>with</strong> a check-in. This association helps maintain traceability<br />

between the changes made to the source code and the work items tracking bugs and tasks.<br />

To configure the work item check-in policy to force developers to associate check-ins<br />

<strong>with</strong> a work item<br />

1. In <strong>Team</strong> Explorer, right-click your team project, select <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 Work Item check-in 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 />

How to Set Up Check-in Policies to Enforce Coding Standards<br />

The code analysis check-in policies that ship <strong>with</strong> <strong>Team</strong> <strong>Foundation</strong> <strong>Server</strong> enable you to<br />

automatically run static code analysis on code as it is checked in, to ensure that the<br />

relevant rules are satisfied. You can fine-tune the code analysis policy to check many<br />

different rules. For example, you can check rules governing design, interoperability,<br />

maintainability, mobility, naming conventions, reliability, and more.<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 and then click Add.<br />

3. In the Add Check-in Policy dialog box, select Code Analysis and then click OK.<br />

4. In the Code Analysis Policy Editor, select either Enforce C/C++ Code Analysis<br />

(/analyze) or Enforce Code Analysis For Managed Code. Select both if your<br />

project contains a combination of managed and unmanaged code.<br />

5. If you select manage code analysis, configure your required rule settings for managed<br />

code analysis based on your required coding standards. This determines precisely<br />

which rules are enforced.<br />

You can also create a custom check-in policy to perform checks that are not available by<br />

default. For example, you can disallow code patterns such as banned API calls, or you<br />

can write a policy to enforce your team’s specific coding style guidelines, such as where<br />

braces should be positioned <strong>with</strong>in your source code.

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

Saved successfully!

Ooh no, something went wrong!