Showing posts with label Check-in Policies. Show all posts
Showing posts with label Check-in Policies. Show all posts

27 May 2010

Check for Warnings/Errors Check-in Policy (2008)

A couple of weeks ago, I posted on an update for the Check for Warnings/Errors Check-in Policy for Visual Studio 2010 / TFS 2010.  This version was posted here on the Visual Studio Gallery.  Since then, I’ve received some questions about an update for the Visual Studio 2008 / TFS 2008 version of this check-in policy as the one I posted last September had an issue when checking in source code from the command line.

I have now also posted an updated version of the Check for Warnings/Errors Check-in Policy for Visual Studio 2008 / TFS 2008.  If you’re still using TFS 2008 (and I’m sure a lot of you are) then you can download the updated check-in policy here.

Usage:

To add this check-in policy to your Team Project:

  1. Download and install the Check for Compilation Warnings and Errors Check-in Policy.  NOTE: Anyone checking in code will need to install the check-in policy on their local development workstations.
  2. Within the Team Explorer in Visual Studio 2008, right-click on the desired Team Project and select Team Project Settings->Source Control.


  3. Click on the Check-in Policy tab, select Check for Compilation Warnings and Error Policy and click OK.


  4. Click on the Edit button and select the level of Warnings and/or Errors to check for.


  5. Click OK and OK to close the dialog windows.

Once installed and configured, the check-in policy works like any other.  You can check the Pending Changes window for violations as seen in this screen shot:

Compatibility:

This version of the Check for Compilation Warnings and Errors Check-in Policy supports Visual Studio 2008 and Team Foundation Server 2008.  The Visual Studio 2010 version is available here.

14 May 2010

Check for Warnings/Errors Check-in Policy

A while back, I wrote about the Check for Warnings/Errors Check-in Policy – a custom check-in policy that I had developed for Team Foundation Server 2008.  Yesterday, I published version 2.1, updated for Team Foundation Server 2010, to the Visual Studio Gallery.  The features are the same as the TFS 2008 version with a couple of exceptions:

  1. You now have the ability to restrict the set of warnings to Code Contract warnings only.
  2. The settings for the check-in policy are now stored as TFS properties (more on this in an upcoming post).

Here are the details…

Usage:

To add this check-in policy to your Team Project:

  1. Download and install the Check for Compilation Warnings and Errors Check-in Policy (see Where to Download below).  NOTE: Anyone checking in code will need to install the check-in policy on their local development workstations.
  2. Within the Team Explorer in Visual Studio 2010, right-click on the desired Team Project and select Team Project Settings->Source Control.

  3. Click on the Check-in Policy tab, select Check for Compilation Warnings and Error Policy and click OK.



  4. Click on the Edit button and select the level of Warnings and/or Errors to check for.  If you select Warnings, you can optionally restrict the set of warnings to Code Contract warnings only by checking the Code Contract Warnings Only checkbox.



  5. Click OK and OK to close the dialog windows.

Once installed and configured, the check-in policy works like any other.  You can check the Pending Changes window for violations as seen in this screen shot:

Compatibility:

This version of the Check for Compilation Warnings and Errors Check-in Policy supports Visual Studio 2010 and Team Foundation Server 2010 only - it is not compatible with Team Foundation Server 2008.

Where to Download:

There are two options for downloading:

  1. You can download this check-in policy directly from the Visual Studio Galleryhere.
  2. From within Visual Studio 2010, you can use the Extension Manager to locate and download the check-in.  To do this:
    1. Click on Tools—>Extension Manager.
    2. Click on the Online Gallery “tab” on the left side of the Extension Manager dialog.
    3. In the Search Online Gallery field, enter “check for warnings” and press Enter.
    4. Locate the “Check for Compilation Warnings and Errors Policy” (at the time of this writing, it is the only item in the search results) and click Download.

If you have any feedback, please utilize the “Reviews” and/or “Discussions” tab on the gallery link above.

21 September 2009

Check for Warnings/Errors Check-in Policy

A few days ago a fellow co-worker asked if I knew of a TFS check-in policy that checks for Visual Studio compilation errors and/or warnings.  I wasn’t aware of such a check-in policy (although it may exist out there somewhere) so I decided to go ahead and create it (who doesn’t love a challenge?!).

When active, this check-in policy will evaluate the current Visual Studio solution to determine if any build warnings and/or errors are present.  If so, the check-in policy will fail and will prevent the code from being checked in (this can, of course, be overridden).

To enable this check-in policy:

  1. Download and install the CheckForWarningsPolicy from here.
  2. Right-click the desired team project within the Team Explorer client and select the “Team Project Settings—>Source Control” menu item.
  3. Click the “Check-in Policy” tab and click “Add”.
  4. Select the “Check for Compilation Warnings and Errors Policy” and click OK.
  5. Click the “Edit” button and select whether you’d like to check for warnings, errors, or both and click OK:

Check for Compilation Warnings and Errors Policy Editor

Once enabled, you will see a list of policy failures in the Policy Warnings tab of the Pending Changes pane:

Pending Changes - Policy Warnings

If you hover over the policy failure, the ToolTip will display the remainder of the filename along with the line and column number and project name of the failure.

UPDATE: You can now double-click on the policy failure to navigate directly to the location within code where the failure occurred (assuming the location information is available).

You can download the CheckForWarningsPolicy from here.