helper for getting lines of code stats
This commit is contained in:
parent
c67c076d89
commit
0058e33cdb
@ -116,17 +116,30 @@ function skip {
|
|||||||
cut -d' ' -f$n-
|
cut -d' ' -f$n-
|
||||||
}
|
}
|
||||||
|
|
||||||
# Unique lines of code
|
cmd_loc="find . -type f \( \
|
||||||
# Via https://text.causal.agency/004-uloc.txt
|
|
||||||
function uloc {
|
|
||||||
find . -type f \( \
|
|
||||||
-name '*.py' \
|
-name '*.py' \
|
||||||
-o -name '*.rb' \
|
-o -name '*.rb' \
|
||||||
-o -name '*.go' \
|
-o -name '*.go' \
|
||||||
-o -name '*.java' \
|
-o -name '*.java' \
|
||||||
-o -name '*.c' -o -name '*.h' \
|
-o -name '*.c' -o -name '*.h' \
|
||||||
-o -name '*.js' \
|
-o -name '*.js' \
|
||||||
\) -exec \cat \{\} \; | sed -e 's/^[ \t]*//;s/[ \t]*$//' | sort -u | wc -l
|
-o -name '*.tsx' \
|
||||||
|
-o -name '*.md' \
|
||||||
|
-o -name '*.xml' \
|
||||||
|
-o -name '*.groovy' \
|
||||||
|
-o -name '*.gradle' \
|
||||||
|
-o -name '*.properties' \
|
||||||
|
\) -exec \cat \{\} \; | LANG=C LC_CTYPE=C sed -e 's/^[ \t]*//;s/[ \t]*$//'"
|
||||||
|
|
||||||
|
# Unique lines of code
|
||||||
|
# Via https://text.causal.agency/004-uloc.txt
|
||||||
|
function uloc {
|
||||||
|
eval "$cmd_loc | LANG=C LC_CTYPE=C sort -u | wc -l"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Top lines of code
|
||||||
|
function toploc {
|
||||||
|
eval "$cmd_loc | cut -c 1-100 | LANG=C LC_CTYPE=C sort | uniq -c | sort -nr"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Find files bigger than X size and sort them by size
|
# Find files bigger than X size and sort them by size
|
||||||
|
Loading…
Reference in New Issue
Block a user