[llvm-commits] [hlvm] r38333 - /hlvm/trunk/utils/countloc.py

Reid Spencer reid at x10sys.com
Sat Jul 7 17:02:26 PDT 2007


Author: reid
Date: Sat Jul  7 19:02:25 2007
New Revision: 38333

URL: http://llvm.org/viewvc/llvm-project?rev=38333&view=rev
Log:
Count documentation lines as well, but separately.

Modified:
    hlvm/trunk/utils/countloc.py

Modified: hlvm/trunk/utils/countloc.py
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/utils/countloc.py?rev=38333&r1=38332&r2=38333&view=diff

==============================================================================
--- hlvm/trunk/utils/countloc.py (original)
+++ hlvm/trunk/utils/countloc.py Sat Jul  7 19:02:25 2007
@@ -27,27 +27,36 @@
 suffixes = ['.h','.cpp','.cxx','.py','.rng','.in','.xsl','.sh','.pm','.hlx',
             '.exp','.ll','.sh']
 
+docsuffixes = ['.html','.css','.pod','.header','.footer','.intro']
+
 filenames = ['SConscript', 'SConstruct','Makefiles' ]
 
 notdirs = ['.svn','Release','Debug','Optimized','Profile','default']
 
 total = 0
+doctotal = 0
 for root, dirs, files in os.walk('.'):
   for name in files:
     (basename,ext) = os.path.splitext(name)
     if ext in suffixes or name in filenames:
-      bytes = getsize(join(root,name))
       lines = 0
       for line in open(join(root,name),'r'):
         lines += 1
-      #print join(root,name), ":", lines,"(",bytes,"bytes )"
+      print join(root,name), ":", lines
       total += lines
+    if ext in docsuffixes:
+      lines = 0
+      for line in open(join(root,name),'r'):
+        lines += 1
+      doctotal += lines
   for d in notdirs:
     if d in dirs:
       dirs.remove(d)
 
 print "Lines Of Code in HLVM:",total
+print "Lines Of Doc  in HLVM:",doctotal
 now = datetime.date.today()
 then = datetime.date(2006,4,24)
 days = now.toordinal() - then.toordinal()
-print "Productivity:",total / ((days * 5) / 7),"loc/day"
+print "Code Productivity:",total / ((days * 5) / 7),"loc/day"
+print "Total Productivity:", (total+doctotal) / ((days * 5) / 7), "lines/day"





More information about the llvm-commits mailing list