Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for counting lines of code with cloc #133

Closed
gkossakowski opened this issue Sep 18, 2014 · 1 comment
Closed

Add support for counting lines of code with cloc #133

gkossakowski opened this issue Sep 18, 2014 · 1 comment

Comments

@gkossakowski
Copy link

One of the most important measures of dbuild's and community build success is lines of code being covered. The cloc tool lets you count LoC easily.

It would be great if dbuild could run cloc for each project it builds. Even more awesome would be cumulative stats printed at the end of dbuild run which show total LoC covered.

Workaround

Current workaround is to run cloc tool manually. Go to community-build's checkout, and then to target-0.9.1/extraction/<latest_sha1>/projects. The <latest_sha1> is printed by dbuild and its a sha1 of unique configuration dbuild is about process.

Once in projects directory, run cloc . and get this:

projects grek (master)$ cloc .
   38470 text files.
   25052 unique files.                                          
   62959 files ignored.

http://cloc.sourceforge.net v 1.60  T=202.50 s (96.5 files/s, 13229.3 lines/s)
--------------------------------------------------------------------------------
Language                      files          blank        comment           code
--------------------------------------------------------------------------------
Scala                         16459         269427         432793        1252565
XML                             609            431            366         330913
Java                           1692          26802          72572         157276
Javascript                      116           9557          16384          54334
HTML                            304           2573             47          12404
CSS                              62           1164            661          10629
Ant                               8           1004           2157           5195
Bourne Again Shell               46            731            604           3301
Python                           14            748           1133           2614
Bourne Shell                     82            432            410           1756
SQL                              14             69              0           1418
Maven                            20             81             23           1345
CoffeeScript                     16             86             79           1054
LESS                             32             70             77            984
YAML                             38             74             31            579
XSLT                              1             30             16            468
C                                 2            119            161            452
DOS Batch                        17             86             42            229
ASP.Net                           1             20              0             91
Perl                              2             12              3             75
DTD                               1             13              5             42
make                              1              6              9             18
C/C++ Header                      1              2              7             12
--------------------------------------------------------------------------------
SUM:                          19538         313537         527580        1837754
--------------------------------------------------------------------------------

Notice we cover over 1.2 million LoC of Scala! Celebrate by watching 🎆 and sipping a 🍸!

@SethTisue
Copy link
Contributor

it's better to use a compiler plugin plus existing dbuild features for this, I think. pursuing it at scala/community-build#59

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants