Sloccy is a source-lines of code CLI tool. Given a path, it'll read all the files in that directory and its subdirectories and figure out how many non-whitespace characters and lines are in each, and then calculates a "score" based on the expected average characters-per-line and number of characters.
-h
flag will print a help message-v
will print the current version-s
will exclude subdirectories-n
will print without color (see./build
)-l
will count only\n
as linebreaks-r
will reset the configuration file-c
will print the configuration
The configuration file is a basic text file that contains
a list of Language-Families, and then the extensions
that belong to that family. Each Language-Family is separated
by a ;
character, and each extension or name is separated
with whitespace.
- custom values for
lineScalar
based on the language. probably get the scores for each language by downloading a bunch of very large samples and seeing what the average char/lines is - custom colors for each language
- updating a directory's
readme.md
with sloccy badges using ghloc
- comments and empty lines do not affect the count
- the last line in the config, if there isn't a space after the last entry, will interpret it as having one less entry than it should
- the
strncmp
function being used incorrectly returnstrue
for strings of mismatched length such as.readme
and.r
since the first parts do match. It also completely ignores thelen
argument. Tried a couple fixes and had no luck so far, so coming back to it later
C 263 pts 9 files, 679 linebreaks, 12k chars
R 43 pts 1 files, 56 linebreaks, 2k chars
Text 52 pts 3 files, 117 linebreaks, 2k chars
Total 358 pts 13 files, 852 linebreaks, 17k chars