CodeIt.Right Code File Header Template For StyleCop Rules
Posted
by Paulo Morgado
on ASP.net Weblogs
See other posts from ASP.net Weblogs
or by Paulo Morgado
Published on Wed, 07 Apr 2010 00:47:24 GMT
Indexed on
2010/04/07
0:53 UTC
Read the original article
Hit count: 900
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.Righ 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:
<#@ 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> //-----------------------------------------------------------------------
© ASP.net Weblogs or respective owner