[go: up one dir, main page]

Skip to content

JohnAlexCO/sloccy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sloccy

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.

image

Basic Usage

  • -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

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.

Planned Features

  • 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

Known Bugs / Missing Features

  • 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 returns true for strings of mismatched length such as .readme and .r since the first parts do match. It also completely ignores the len argument. Tried a couple fixes and had no luck so far, so coming back to it later

Sloccy's Score

ghloc score

Endpoint Badge Endpoint Badge Endpoint Badge

Self-Given score

           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