Click here to Skip to main content
Click here to Skip to main content
Technical Blog

CodeIt.Right Code File Header Template For StyleCop Rules

, 10 May 2010 CPOL
Rate this:
Please Sign up or sign in to vote.
CodeIt.Right Code File Header Template For StyleCop Rules

I like to use both StyleCop and CodeIt.Right to validate my code – StyleCop because it’s free and CodeIt.Right because it’s really good.

While StyleCop provides only validation, CodeIt.Right provides both validation and correction of violations.

Unfortunately, CodeIt.Right’s supplied template for code file headers does not conform to StyleCop rules.

Fortunately, CodeIt.Right allows us to define our own template. Here’s the one I use:

free hit counters
<#@ template language="C#" #>
//-----------------------------------------------------------------------
// <copyright file="<#= System.IO.Path.GetFileName(Context.DestinationFile) #>"
//            project="<#= Context.ProjectName #>"
//            assembly="<#= Context.AssemblyName #>"
//            solution="<#= Context.SolutionName #>"
//            company="<#= Context.GetGlobalProperty("CompanyName") #>">
//     Copyright (c) <#= Context.GetGlobalProperty("CompanyName") #>. All rights reserved.
// </copyright>
// <author id="<#= Context.GetGlobalProperty("UserID") #>">
// <#= Context.GetGlobalProperty("UserName") #></author>
// <summary></summary>
//-----------------------------------------------------------------------

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Paulo Morgado
Software Developer (Senior) Paulo Morgado
Portugal Portugal

Comments and Discussions

 
GeneralMy vote of 5 Pinmembercodeziwei30-Oct-12 2:37 
Good
GeneralRe: My vote of 5 PinmemberPaulo Morgado30-Oct-12 14:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.141216.1 | Last Updated 10 May 2010
Article Copyright 2010 by Paulo Morgado
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid