Activating the policy

After installation on the developer workstations, you can activate the checkin policy in Team Explorer.

cp_addingthepolicy.png

In the Source Control Settings dialog, switch to the Check-In Policy tab and click the Add button.

cp_selectcccp.png

Select "Check for Code Comments 2.1 Policy" and click OK. This opens the policy configuration with its defaults.

cp_defaults.png

Close all dialogs with OK and the checkin policy is active immediately.

Customizing the policy's behavior

By default, only public methods are checked for both C# and VB.NET. Obviously, you can add additional member types and visibility by simply selecting the respective check boxes.

cp_nondefaults.png

Note that unchecking "Check Override Elements" means that if you are overriding eg methods from a base class, this derived class won't be checked for comments (those will be checked for the class defining the overridable method).

All the settings on the first configuration tab by default apply to the entire team project. Most often times, you want to limit checking to class library projects which are being reused and documentation in the form of help files is useful. Take this demo project:

cp_scexplorer.png

The only project really suited for code comments is DemoClassLib. So instead of checking the entire team project, you can limit CCCP to include only certain source control directories (and its subdirectories) into the checking:

cp_limittoincludeddirectories.png

From now on, all source files from other directories are ignored and no longer checked.

Another useful feature is to exclude certain namespaces from checking. A common reason for this are namespaces that contain autogenerated code such as from Codesmith or GAT / GAX guidances.

cp_excludenamespaces.png

Exclusion means "This namespace and all nested namespaces".

Last edited Jul 19, 2007 at 3:12 PM by ChristophWille, version 5

Comments

bihe Mar 3, 2010 at 2:29 PM 
Best namespace I've ever seen! Especially if you're from Austria.