Giter Site home page Giter Site logo

loc's Introduction

2019-10-07: I really haven't been on top of accepting pull requests or looking at issues, you guy should definitely look at SCC. It's faster and more accurate than this, and Boyter has written a great series of blog posts detailing how it got this way: https://boyter.org/posts/sloc-cloc-code/

2018-03-08: I saw a bunch of stars pop up and thought I should mention that tokei is smarter and more accurate so please give that a look and see if there are any wild discrepancies (mostly for your benefit but please let me know if so). Tokei is linked below but it's also rust so cargo install tokei is all you need. Also these benchmarks are quite old. I doubt cloc has changed but tokei probably has.

loc is a tool for counting lines of code. It's a rust implementation of cloc, but it's more than 100x faster. There's another rust code counting tool called tokei, loc is ~2-10x faster than tokei, depending on how many files are being counted.

I can count my 400k file src directory (thanks npm) in just under 7 seconds with loc, in a 1m14s with tokei, and I'm not even willing to try with cloc.

Counting just the dragonflybsd codebase (~9 million lines):

  • loc: 1.09 seconds
  • tokei: 5.3 seconds
  • cloc: 1 minute, 50 seconds

Installation

There are binaries available on the releases page, thanks to the wonderful rust-everywhere project and travisci. For anyone familiar with Rust there's cargo install loc. If you want to install Rust/Cargo, this is probably the easiest way: https://www.rustup.rs/.

Windows

loc should now compile on Windows, but you can also run it under Windows using linux emulation:

You can run loc on Windows 10 Anniversary Update build 14393 or later using the Windows Subsystem for Linux. Simply download the Linux distribution from the releases page, and run it in bash using a WSL-compatible path (e.g. /mnt/c/Users/Foo/Repo/ instead of C:\Users\Foo\Repo).

Usage

By default, loc will count lines of code in a target directory:

$ loc
--------------------------------------------------------------------------------
 Language             Files        Lines        Blank      Comment         Code
--------------------------------------------------------------------------------
 Lua                      2       387088        24193       193544       169351
 Rust                     4         1172          111           31         1030
 C                        4          700           75          155          470
 Markdown                 2          249           39            0          210
 Bourne Shell             4          228           41           27          160
 Ada                      2           53           12            9           32
 Toml                     1           26            4            2           20
 Gherkin                  1           12            2            2            8
 OCaml                    1           13            4            6            3
 Ruby                     1            4            0            2            2
 Handlebars               1            4            0            2            2
--------------------------------------------------------------------------------
 Total                   23       389549        24481       193780       171288
--------------------------------------------------------------------------------

You can also pass one or many targets for it to inspect

$ loc ci benches
--------------------------------------------------------------------------------
 Language             Files        Lines        Blank      Comment         Code
--------------------------------------------------------------------------------
 Bourne Shell             4          228           41           27          160
 Rust                     1           17            4            0           13
--------------------------------------------------------------------------------
 Total                    5          245           45           27          173
--------------------------------------------------------------------------------

To see stats for each file parsed, pass the --files flag:

$ loc --files src
--------------------------------------------------------------------------------
 Language             Files        Lines        Blank      Comment         Code
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
 Rust                     2         1028           88           29          911
--------------------------------------------------------------------------------
|src/lib.rs                         677           54           19          604
|src/main.rs                        351           34           10          307

By default, the columns will be sorted by Code counted in descending order. You can select a different column to sort using the --sort flag:

$ loc --files --sort Comment ci
--------------------------------------------------------------------------------
 Language             Files        Lines        Blank      Comment         Code
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
 Bourne Shell             4          228           41           27          160
--------------------------------------------------------------------------------
|ci/before_deploy.sh                 68           15           13           40
|ci/install.sh                       60           13            6           41
|ci/script.sh                        41            8            8           25
|ci/utils.sh                         59            5            0           54

loc can also be called with regexes to match and/or exclude files.

$ loc --include 'count'
--------------------------------------------------------------------------------
 Language             Files        Lines        Blank      Comment         Code
--------------------------------------------------------------------------------
 Rust                     2          144           23            2          119
--------------------------------------------------------------------------------
 Total                    2          144           23            2          119
loc --exclude 'sh$'
--------------------------------------------------------------------------------
 Language             Files        Lines        Blank      Comment         Code
--------------------------------------------------------------------------------
 Lua                      2       387088        24193       193544       169351
 Rust                     4         1172          111           31         1030
 C                        4          700           75          155          470
 Markdown                 2          275           38            0          237
 Ada                      2           53           12            9           32
 Toml                     1           26            4            2           20
 Gherkin                  1           12            2            2            8
 OCaml                    1           13            4            6            3
 Handlebars               1            4            0            2            2
 Ruby                     1            4            0            2            2
--------------------------------------------------------------------------------
 Total                   19       389347        24439       193753       171155
--------------------------------------------------------------------------------

Known Issues

Fortran has a rule that comments must start with the first character of a line. I only check if it's the first non-whitespace character of a line. I don't know how often this is a problem in real code. I would think not often.

Comments inside string literals: You can get incorrect counts if your code has something like this:

x = "/* I haven't slept \
for 10 days \
because that would be too long \
*/";

loc counts the first line and last lines correctly as code, but the middle lines will be incorrectly counted as comments.

Ignored and hidden files:

By default, loc respects .gitignore/.ignore files, and ignores hidden files and directories. You can count disregard ignore files with loc -u, and include hidden files/dirs with loc -uu.

Supported Languages

  • ActionScript
  • Ada
  • Agda
  • AmbientTalk
  • ASP
  • ASP.NET
  • Assembly
  • Autoconf
  • Awk
  • Batch
  • Bourne Shell
  • C
  • C Shell
  • C/C++ Header
  • C#
  • C++
  • Clojure
  • CoffeeScript
  • ColdFusion
  • ColdFusionScript
  • Coq
  • CSS
  • CUDA
  • CUDA Header
  • D
  • Dart
  • DeviceTree
  • Erlang
  • Forth
  • FORTRAN Legacy
  • FORTRAN Modern
  • F# (Fsharp)
  • GLSL
  • Go
  • Groovy
  • Handlebars
  • Haskell
  • Hex
  • HTML
  • Idris
  • INI
  • Intel Hex
  • Isabelle
  • Jai
  • Java
  • JavaScript
  • JSON
  • Jsx
  • Julia
  • Kotlin
  • Lean
  • Less
  • LinkerScript
  • Lisp
  • Lua
  • Make
  • Makefile
  • Markdown
  • Mustache
  • Nim
  • Nix
  • Objective-C
  • Objective-C++
  • OCaml
  • OpenCL
  • Oz
  • Pascal
  • Perl
  • PHP
  • Plain Text
  • Polly
  • PowerShell
  • Prolog
  • Protobuf
  • Pyret
  • Python
  • Qcl
  • QML
  • R
  • Razor
  • reStructuredText
  • Ruby
  • RubyHtml
  • Rust
  • SaltStack
  • Sass
  • Scala
  • SML
  • Solidity
  • SQL
  • Stylus
  • Swift
  • Tcl
  • Terraform
  • TeX
  • Toml
  • TypeScript
  • Tsx
  • UnrealScript
  • VimL
  • Wolfram
  • XML
  • Yacc
  • YAML
  • Zig
  • Z Shell

Attributions

This project contains code from Tokei by Aaronepower and ripgrep by BurntSushi.

Contributors

loc's People

Contributors

aaronepower avatar adamtheturtle avatar aligorith avatar amilajack avatar bennyyip avatar cgag avatar connorgray avatar cypressious avatar dfilatov avatar dpsutton avatar erewok avatar gakonst avatar gebner avatar glennpratt avatar gyrosofwar avatar innectic avatar jez avatar jhpratt avatar jswrenn avatar little-dude avatar mclehman avatar milesq avatar mroth avatar nathansizemore avatar oussama avatar overdrivenpotato avatar pthariensflame avatar rubdos avatar strangelittlemonkey avatar tiehuis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

loc's Issues

Nested comments not handled for Haskell or Rust files

Cool tool! Just found it because sloccount refuses to work any more. This is far faster!

With the .rs file example here, tokei correctly reports 1 line of code, whereas loc incorrectly reports 14 lines of code.

Haskell also has nestable block comments:

{-

{-
Nested comment
-}

-- Note: still commented
fibs :: [Int]
fibs = 1 : 1 : zipWith (+) fibs (tail fibs)

-}

main :: IO ()
main = print [1..]

tokei correctly reports 2 lines of code, whereas loc incorrectly reports 5 lines.

Count Hits of Code

Very nice tool!

I am wondering if you could add 'Hits of Code' into it.
What is 'Hits of Code': https://github.com/yegor256/hoc

'Hits of Code' is very useful parameter, since it allows to measure:

  1. how much effort was spent into your code base
  2. what are the parts which change the most

I know rust just a little bit, so I guess I can help, but I am not sure I will do it correctly.

Thanks!

Git files include in lines of count

First, I want to say that I'm really impressed with the speed of loc! Now on to the issue:

I noticed that when I run "loc ." in the project root that the directory's git directory is included in the results. I propose either disabling git directories or disabling hidden directories from the results. Thoughts?

Integer overflow issue?

When running loc as loc . --files on the phpSimpleSAML project
I get the following output

--------------------------------------------------------------------------------
 Language             Files        Lines        Blank      Comment         Code
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
 Bourne Shell             2           86           19            6           61
--------------------------------------------------------------------------------
|./bin/build-release.sh              62           15            3           44
|./bin/check-syntax.sh               24            4            3           17
--------------------------------------------------------------------------------
 PHP                    473        65104        10377        18319        36408
--------------------------------------------------------------------------------
|templates/authsources.php          402           58          461   4294967179
|es/saml/lib/IdP/SAML2.php         1149          180          188          781
|L/Metadata/SAMLParser.php         1498          267          493          738
|tlibinc/base_facebook.php         1437          140          561          736
|pleSAML/Configuration.php         1369          205          528          636
...

There seems to be something going wrong with 4294967179

This is on:
MacOS El Capitan
loc version 0.3.4
rustc 1.12.1 (d4f39402a 2016-10-19)

loc doesn't respect directories ignored by .gitignore

Bug found with version 0.3.4 of loc.
When I run loc on a directory like the one that follows, loc doesn't ignore directories ignored by gitignore. This is odd to me because ripgrep currently has the correct behavior.

Given the following directory:

loc-gitignore $ tree .
.
├── hello_rust.rs
├── ignored
│   └── hello_rust.rs
├── ignored2
│   └── hello_rust.rs
└── unignored
    └── hello_rust.rs

3 directories, 4 files

And the following .gitignore file:

loc-gitignore $ more .gitignore
ignored/
ignored2

loc gives the following results:

loc-gitignore $ loc
--------------------------------------------------------------------------------
 Language             Files        Lines        Blank      Comment         Code
--------------------------------------------------------------------------------
 Rust                     4           12            0            0           12
--------------------------------------------------------------------------------
 Total                    4           12            0            0           12
--------------------------------------------------------------------------------
loc-gitignore $ 

Where rg ignores the folders correctly:

loc-gitignore $ rg a
hello_rust.rs
1:fn main() {

unignored/hello_rust.rs
1:fn main() {

Dockerfile support

Looking at the current code, I'm not sure how this would be implemented in a clean manner. However, this would still be a nice feature to have.

Allow multiple targets

With cloc I can do the following:
cloc $(git ls-files)

But loc expects only a single target:

$ loc $(git ls-files)
error: Found argument 'CHANGELOG' which wasn't expected, or isn't valid in this context

Also happens for wildcards:

$ loc *.php
error: Found argument 'export.php' which wasn't expected, or isn't valid in this context

Where export.php was the second file in the directory I ran the command in.

New release?

At the moment the Cargo.lock of the current release does not contain hashes - this is currently breaking our package in nixpkgs, where we need them for offline builds.

Add PowerShell script support

It'd be awesome if we could see the PowerShell script support added to this program!

PowerShell scripts are identifiable by the file extension .ps1. They have a block comment syntax (<# blah blah #>) in addition to the line comment syntax (# blah blah) commonly seen in many scripting languages.

Typescript + JSX

Typescript files that contain JSX have the .tsx extension.

Those files are currently not recognized by loc.

Ability to add new languages

I have a codebase which is partially Clojure (.clj), partially ClojureScript (.cljs) and partially both of them (.cljc). Right now only .clj files are counted.

Of course, languages could be added right to the binary, but maybe having option to add new file extensions is a good thing too. :)

Limit default output to 80 chars

loc currently prints 81 chars for the dashed-lines, which is ugly on a default 80x24 terminal.

% ./target/debug/loc . | wc -L
81

discrepancy reported between loc and cloc on the exact same repo

I just cloned and cargo built loc from the repo. Here are the results I've tested on the exact same test code base.

As you can see there are quite significant discrepancies reported by the two programs. If loc were a re-implementation of cloc then I would expect the discrepancies to be small if there were any.

$ loc -V
count 0.1
$ loc codebase
---------------------------------------------------------------------------------
 Language              Files        Lines        Blank      Comment         Code
---------------------------------------------------------------------------------
 JavaScript             9080      1032352       131646       225231       675475
 JSON                   1139       133076          369            0       132707
 Markdown               1115       159295        46234            0       113061
 Python                  207        70457        12095         4561        53801
 C++                      64        26719         3483         3171        20065
 HTML                    211        21543         2607         1867        17069
 Sass                    112        18359         1665         1497        15197
 C/C++ Header             97        17423         2551         1711        13161
 XML                      21         9826          475           22         9329
 YAML                    247         6611          260           70         6281
 CSS                      41         7625         1157          529         5939
 Plain Text               75         1933          330            0         1603
 Makefile                 49         2624          438          738         1448
 SQL                       2         1325          238            0         1087
 Lua                       6         1209          225           36          948
 TypeScript                2         1038          141          104          793
 Less                      3          797           94           11          692
 Bourne Shell             21          840          142          123          575
 Autoconf                  4          799           74          263          462
 Lisp                      4          350           42           38          270
 ASP.NET                   6          265            0            0          265
 Handlebars                4          200           18            0          182
 C                         5          258           45           37          176
 CoffeeScript             11          112           23            9           80
 Ruby                      3           26            4            2           20
 Batch                     2           10            2            0            8
 Z Shell                   1           25            4           15            6
---------------------------------------------------------------------------------
 Total                 12532      1515097       204362       240035      1070700
---------------------------------------------------------------------------------


$ cloc codebase
   13950 text files.
    9763 unique files.                                          
    5923 files ignored.

https://github.com/AlDanial/cloc v 1.66  T=58.68 s (138.1 files/s, 20273.4 lines/s)
-----------------------------------------------------------------------------------
Language                         files          blank        comment           code
-----------------------------------------------------------------------------------
JavaScript                        6082         110844         185893         584265
JSON                              1048            331              0         123278
Python                             189          12106           8513          49919
C++                                 64           3483           3174          20062
HTML                               204           2599            165          18683
SASS                               111           1665           1078          15616
C/C++ Header                        97           2550           1711          13162
XML                                 19            242             11           7381
CSS                                 39           1157            528           5940
YAML                               156            241             66           5684
Bourne Shell                        24            474            454           2136
SQL                                  2            238              0           1087
TypeScript                           2            141            104            793
Lua                                  5            168             27            686
LESS                                 2             82             10            606
make                                25            178             40            575
m4                                   2             40              2            266
Lisp                                 3             42             38            264
Bourne Again Shell                  10             54             27            184
C                                    3             31             29            130
Smarty                               6             17             30             91
CoffeeScript                         5             16              8             65
Handlebars                           2              8              0             42
Windows Resource File                1              1              1             33
Ruby                                 2              2              2             12
DOS Batch                            2              2              0              8
zsh                                  1              4             14              7
-----------------------------------------------------------------------------------
SUM:                              8106         136716         201925         850975
-----------------------------------------------------------------------------------

PS: loc took around 2-3 seconds to finish, it would be nice to have the elapsed time reported in the result output as well. And cloc took almost a minute, so it's about 20-30x improvement not the 100x as claimed.

Incorrect counts when multi-line pattern has the single-line pattern as a prefix.

For example, broken.lua:

--[[ This
     is
     a
     multi-line
     comment,
     not
     code. ]]

Expected output:

---------------------------------------------------------------------------------
 Language              Files        Lines        Blank      Comment         Code
---------------------------------------------------------------------------------
 Lua                       1            7            0            7           0

Actual output:

---------------------------------------------------------------------------------
 Language              Files        Lines        Blank      Comment         Code
---------------------------------------------------------------------------------
 Lua                       1            7            0            1            6

This occurs because the opening character sequence of a multi-line comment has the character sequence of a single-line comment as its prefix:

    Lua => SM("--", "--[[", "]]"),

I ran into this bug while adding the comment patterns for a language which uses # for single-line comments, and #| and |# for multi-line comments.

Weird filenames in list

loc currently produces for my project some weird filename output (./ vs / vs no prefix):

--------------------------------------------------------------------------------
 Language             Files        Lines        Blank      Comment         Code
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
 Markdown                 1           22            8            0           14
--------------------------------------------------------------------------------
|./README.md                         22            8            0           14
--------------------------------------------------------------------------------
 Toml                     8          224           30            0          194
--------------------------------------------------------------------------------
|./aorta/Cargo.toml                  37            4            0           33
|./server/Cargo.toml                 37            5            0           32
|./trove/Cargo.toml                  31            3            0           28
|./Cargo.toml                        35            7            0           28
|./config/Cargo.toml                 31            4            0           27
|./cabi/Cargo.toml                   26            4            0           22
|./common/Cargo.toml                 18            1            0           17
|./cabi/cbindgen.toml                 9            2            0            7
--------------------------------------------------------------------------------
 Python                   8          520          111            5          404
--------------------------------------------------------------------------------
|./py/setup.py                      112           20            2           90
|./py/smith/auth.py                 113           26            0           87
|./py/smith/utils.py                103           23            2           78
|./py/smith/exceptions.py            59           15            0           44
|pts/git-precommit-hook.py           49           10            1           38
|./py/smith/_compat.py               31            5            0           26
|./py/tests/test_auth.py             31            8            0           23
|./py/smith/__init__.py              22            4            0           18
--------------------------------------------------------------------------------
 Rust                    27         3723          450          446         2827
--------------------------------------------------------------------------------
|./aorta/src/auth.rs                549           77           68          404
|./trove/src/types.rs               413           45           74          294
|./cabi/src/core.rs                 305           29           35          241
|./common/src/dsn.rs                243           36           12          195
|aorta/src/projectstate.rs          313           28           94          191
|./config/src/types.rs              235           26           33          176
|./aorta/src/query.rs               205           24           13          168
|./aorta/src/upstream.rs            190           24           25          141
|./cabi/src/aorta.rs                181           22           19          140
|./common/src/auth.rs               156           15           13          128
|/common/src/project_id.rs          146           18           14          114
|./trove/src/auth.rs                114           15            7           92
|./cabi/src/utils.rs                 90           10            3           77
|./server/src/service.rs             87           19            0           68
|./trove/src/heartbeat.rs            75           10            2           63
|./aorta/src/config.rs               83            7           16           60
|./src/main.rs                       72           10            2           60
|./server/src/errors.rs              63           12            4           47
|./common/src/macros.rs              42            5            0           37
|./aorta/src/lib.rs                  34            2            1           31
|./trove/src/lib.rs                  27            2            4           21
|./server/src/lib.rs                 23            2            1           20
|./common/src/lib.rs                 22            2            1           19
|./config/src/lib.rs                 19            3            1           15
|./cabi/src/lib.rs                   15            3            0           12
|./aorta/src/api.rs                  14            3            3            8
|./common/src/utils.rs                7            1            1            5
--------------------------------------------------------------------------------
 YAML                     1           26            5            0           21
--------------------------------------------------------------------------------
|./appveyor.yml                      26            5            0           21
--------------------------------------------------------------------------------
 C/C++ Header             1          215           34          113           68
--------------------------------------------------------------------------------
|./cabi/include/smith.h             215           34          113           68
--------------------------------------------------------------------------------
 Makefile                 3           40           12            0           28
--------------------------------------------------------------------------------
|./Makefile                          23            8            0           15
|./py/Makefile                       13            3            0           10
|./cabi/Makefile                      4            1            0            3

Suggestions re --files & output

I've just started using loc and find it useful.

However, I wish there was a -f option as a short form of --files. Also I wish there was a -s and --summary option which would just list the first (Language & Files) & last (Code lines) columns.

`loc` returns a count of 0 for files without an extension

This may be by design, but:

Write the following to a file named e.g. foo.py:

#!/bin/python

hello = "Count me!"

Run loc foo.py. You'll get the expected result, 1 line of Python. Now run mv foo.py foo and run loc foo. The result shows 0 lines of anything.

This may be out of scope for loc (detecting filetypes without an extension can be hard), but it does mess up counts for codebases with scripts named without extensions, e.g. run_task, etc.

What would be required for loc to return counts for files without extensions?

Update readme to include F#

F# is in fact supported, but isn't listed in the readme. Easy fix! Also thanks so much for this astoundingly fast utility!

cython support

Cython is a third-party tool to make Python extensions (filenames of whose code file usually end with .pxd or .pyx). Would you consider to add it?

exclude whole folders

Would be wonderful to have an option to exclude whole sub-directories from being counted by 'loc'

HLSL and CG support

Is it possible to add support for the mentioned shader files? Cloc counts loc in *.shader files containing CG & HLSL code.

Can you add reading from stdin?

Would be cool to be able to download tar or zip with wget -qO- and pipe it loc without even saving it to know how much lines of code github project has.

Feature request: speed up with stay running and refresh

Currently you run loc, it prints its result and exits. You could add a kind of interactive mode:

% loc -i
>loc
[prints a count of lines in the usual format]
>loc
[rechecks the current directory and prints a new count]
>exit
%

The second count would be faster because it will remember the timestamp of the files it read last time, and not bother re-reading them if the timestamp has not changed. Even without that caching, there will be a saving on startup overhead compared to running the executable twice.

The envisaged use is for getting a history of line counts over several commits in a version control system such as git. Currently you can check out one revision, run loc, check out the next, run loc again, and so on. It would be faster if loc stayed running and could be poked to recompute the count of lines, without having to scan all the files that haven't changed between the two revisions.

Filename truncation

loc truncates filenames even though my terminal is very wide. I wish loc would read the terminal's width and give any extra space to the filenames column (when using --files).

Also, I wish there was a config file it'd read e.g., to specify default options including includes & excludes.

Hi, Can you add a COLUMN for Percentage?

look like the follow probably:

--------------------------------------------------------------------------------
 Language       Percentage      Files        Lines        Blank      Comment         Code
--------------------------------------------------------------------------------
 Rust              85.39%      13         1637          137          103         1397
 Toml              0.20%       4          156           28           17          111
 Markdown           0.20%      1           59           15            0           44
 CSS                0.20%      1           65           15            7           43
--------------------------------------------------------------------------------
 Total             100%      19         1917          195          127         1595
--------------------------------------------------------------------------------

Lisp documentation strings are counted as code

This lisp code :

(defun f (x y)
"Adds two numbers."
  (+ x y))

is (roughly) equivalent to this java code :

/** Adds two numbers. */
public int f (int x, int y)
{
    return x + y ;
}

In Lisp, "Adds two numbers." is a documentation string, equivalent to javadoc in java. I think this should not be counted as code but as comment instead. Other documentation strings are more difficult to catch, but for functions, methods, macros, ... the problem is the same.

Maybe lines with only a { or a } should not be counted at all in java, but this a a problem only for langages comparisons...

CSV output

Hello,

It would be nice to add a possibility for printing out the LoC information in CSV format, similar to output of cloc --csv
It should also be possible to have the CSV output in the by-file mode: loc --files --csv

The CSV output is useful when one is going to use the LoC data together with version control data for analysis of hotspots in teh given codebase using code-maat and maat-scripts as described in the book Your Code as a Crime Scene

output format?

tokie support these options: --output json, --output csv
it is very useful when integrating into workflow.

Support multiple --exclude

Currently if you invoke with multiple --exclude you get:

error: The argument '--exclude <REGEX>' was provided more than once, but cannot be used multiple times

Provide License

I'd like to package this for nixos, but I want a license file for it - could you provide one?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.