LexaCount - Count lines of code
Wrote this small utility in C for counting lines of code which includes:
- Line counting which excludes comments and blank lines
- Option to exclude lines containing only brackets or parenthesis
- Formatting as text/tables
- Bulk file names loading from a file name list
https://github.com/anic17/LexaCount/releases
GitHub
Releases · anic17/LexaCount
LexaCount is a utility to count source lines of code - anic17/LexaCount
24 Replies
Line counting which excludes comments and blank linesPlease make it an option to include these, by default it should exclude though
Option to exclude lines containing only brackets or parenthesisTo me this relates with the same thing above, as it's not really sloc imo, as a line with just a
{
or }
Formatting as text/tablesIf the terminal is too small to render a table properly how is that handled
Bulk file names loading from a file name listDo you mean going through a file that has file names in it? To me it just makes sense to have the cli take in as many files as a person wants (which it seems to do, so I don't understand what you mean here) -------- 1. Would it be possible to add color? I think it's a cute little idea that could be toggled with a flag, but I think it would help make LexaCount stand out from other loc utilities 2. Could you add a screenshot of the final output in the readme? Nothing in the readme shows what the table actually looks like 3. I think showing some stats would be pretty neat. Like for example: - total line count - # of blank lines - # of code comments - # of true code lines (so just sloc, ignoring blank lines, comments, and etc) After running the program it does seem to have some of these, although that was never touched on in the readme (heres where adding that screenshot would be nice)
@earth's bird damn, you went off didn't you
The table displays exactly what you mentioned
I can easily add an option to include blank lines and comments as part of the code, that's a quick thing
The CLI takes as many files as the person wants and also as many list files as they want
I believe it's helpful to be able to load a bunch of filenames from a list. Maybe I should add more examples and have a more detailed readme to show clearly what it can do.
As per the color, I can think of this, shouldn't either be too hard to implement
Lol, wasn't the intention I just like giving feedback
Then this should be mentioned in the readme
or shown by a screenshot
Screenshots are much more attention catching then text too, so I think a screenshot would be best
I think it needs a clearer description of what a sloc is. In my personal opinion, if a line is deleted and this affects how the program compiles, its a sloc. If deleting it does nothing, then it's not a sloc
will add one, it is more descriptive
Still not added, I'm sure you have lots of other things going on. Just letting you know I'm still watching this project!
yeah sorry I've been busy this week and will be quite inactive the next two weeks, lots of irl stuff going on
Ah, I hope all is well
lots of school work
Drats, that sucks. I understand that
done now, let me know what you think
I think it should be the first thing shown
Rather than the last thing
The addition of the screenshot is nice though
Maybe
I think LexaCount's table leaves some stuff to be desired though
Well it being attention grabbing I find it's best to have it be the first thing seen
Changed, let me know now
Much better imo
What would you add?
It's hard to put my finger on but really the design of the table is well. A bit nasty. The separation of the final total should be more obvious. The headers: File, Code lines, Blank, Comments, Brackets only, should all be more seperated from the data in the table
If that makes sense
Visually it's lacking, information wise I think it's good
Here are some examples of tables in the terminal I think you could get inspired from
Some do use unicode but that's less of the point I was trying to make, I think they all look good and feel right
They all have a good seperatation of the headers from the data
For lexacount I almost prefer the minimal style of something like this