Hey,

I'm working for a company with a pretty sharp code review tool. There are 
hundreds of things it checks for. One of them is tab characters. We can't have 
any tabs in our source. 

I thought I could stay ahead of the curve by using my own tool that'd run a few 
checks on my directory, and clean things up a bit. 

I found my old "Count the lines of code" thread, where the tool runs through 
the directory and counts the lines. 

Could I modify this to fit my needs? OR should I just build a new regex tool?

<cfdirectory directory="c:\webRoot\someSite" action="list" name="mySite" 
filter="*" sort="directory" recurse="yes">

<cfset totalLines = 0>

 <!---loop over all the files and filter on list of extensions---> 
 <cfloop query="mySite">  
 <cfif type eq "file"> 
   <cffile action="read" file="#directory#\#name#" variable="curFile" >
     <cfif  "cfc,cfm,xml,as,sql,css,html" CONTAINS listGetAt(name, 2, '.')> 
     <!---create an array of line items (parse by ascii carriage return and 
output the name of the file---> 
     <cfset myArray = listToArray(curFile, "#Chr(13)#")> 
        <cfoutput>#name#<br /></cfoutput>
        <!---add current files line count to total---> 
        <cfset totalLines = totalLines + arrayLen(myArray)> 
     </cfif>
  </cfif>
  </cfloop>
  
  <!---output line count total--->
  <cfoutput>#totalLines#</cfoutput> 

Thanks,
Will 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:308199
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to