https://github.com/johnalexinl/sloccy
https://github.com/johnalexinl/sloccy
lines-of-code sloc source-lines source-lines-of-code
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/johnalexinl/sloccy
- Owner: JohnAlexINL
- Created: 2024-09-16T05:23:08.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-09-16T19:43:19.000Z (8 months ago)
- Last Synced: 2025-01-28T15:39:52.211Z (3 months ago)
- Topics: lines-of-code, sloc, source-lines, source-lines-of-code
- Language: C
- Homepage: https://modula.dev
- Size: 19.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# 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.
## 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](https://github.com/pajecawav/ghloc-web)## 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


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