-
-
Save alco/2165064 to your computer and use it in GitHub Desktop.
git ls-files | egrep '\.erl|\.ex[s]$' | xargs cat | sed '/^$/d' | wc -l |
A year later, it shows 15657 lines for code for Elixir.
Shouldn't it be
git ls-files | egrep '\.erl|\.exs?$' | xargs cat | sed '/^$/d' | wc -l
The original only matched .exs
files for me.
Same command shows 34229 lines of code for Elixir as of elixir-lang/elixir@3f9ea58
The sed command can be changed to sed '/^$\|^\s*#/d'
to ignore comment only lines
@minhajuddin for some reason I get more lines with your regex ; I've also tried this one sed '/(?:^$)|(?:^\s*#)/d'
which yields the same results as yours.
by piping twice, though, I get the comment lines removed, as in:
git ls-files | egrep '\.erl|\.exs?$' | xargs cat | sed '/^$/d' | sed '/^\s*#/d' | wc -l
Same command show following line counts for different Elixir releases:
- v1.13.4 174794
- v1.12.3 165455
- v1.11.4 160327
- v1.10.4 152321
- v1.9.4 143453
- v1.8.2 136553
- v1.7.4 131250
- v1.6.6 125171
- v1.5.3 105227
- v1.4.5 96795
- v1.3.4 89698
- v1.2.6 80185
- v1.1.1 76340
- v1.0.5 69211
- v0.9.3 42682
- v0.8.3 38633
- v0.7.2 31105
- v0.6.0 25127
- v0.5.0 16887
Command that worked for me on MacOS to count all LoC (including ex
and exs
files), ignoring blank lines and comments:
git ls-files | egrep '\.erl|\.exs?$' | xargs cat | sed '/^\s*$/d' | sed '/^\s*#/d' | less
As of https://github.com/elixir-lang/elixir/tree/0df09a97488ceafe4133b024a79dca62c63a0165 I get 6529 lines of code. Pretty neat!
Compare that to Clojure's 72169.