Permalink
Browse files

A shell function to count non-comment/blank lines using cloc.

Less than 8500 lines, plus ~300 lines of ASDL schemas.

Unrelated:
- Mark command_.test.sh as green.
  • Loading branch information...
Andy Chu
Andy Chu committed Jan 13, 2018
1 parent 27987ea commit 5af17e13614492275f32dfcd844a5d7ef2aad681
Showing with 16 additions and 3 deletions.
  1. +15 −2 scripts/count.sh
  2. +1 −1 test/spec.sh
View
@@ -13,6 +13,20 @@ filter-py() {
grep -E -v '__init__.py$|_test.py$'
}
oil-core-files() {
{ ls {bin,osh,core}/*.py native/*.c osh/osh.asdl core/runtime.asdl; } |
filter-py | grep -E -v '_gen.py$|test_lib.py'
}
cloc-oil-core() {
oil-core-files | xargs cloc
# cloc doesn't understand ASDL files.
echo
echo 'ASDL SCHEMAS'
wc -l core/runtime.asdl osh/osh.asdl
}
# TODO: Sum up all the support material. It's more than Oil itself! Turn
# everything into an array. An hash table of arrays would be useful here.
all() {
@@ -69,8 +83,7 @@ all() {
echo
echo 'OIL'
{ ls {bin,osh,core}/*.py native/*.c osh/osh.asdl core/runtime.asdl; } |
filter-py | grep -E -v '_gen.py$|test_lib.py' |
oil-core-files |
xargs wc -l | sort --numeric
echo
View
@@ -330,7 +330,7 @@ command-sub() {
}
command_() {
sh-spec spec/command_.test.sh --osh-failures-allowed 1 \
sh-spec spec/command_.test.sh \
${REF_SHELLS[@]} $OSH "$@"
}

0 comments on commit 5af17e1

Please sign in to comment.