Skip to content

Instantly share code, notes, and snippets.

@alco
Created March 22, 2012 22:20
Show Gist options
  • Save alco/2165064 to your computer and use it in GitHub Desktop.
Save alco/2165064 to your computer and use it in GitHub Desktop.
Count the number of non-blank SLOC in an Elixir project
git ls-files | egrep '\.erl|\.ex[s]$' | xargs cat | sed '/^$/d' | wc -l
@TheArrowsmith
Copy link

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

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