Python Count Lines of Code.
This program read source code,
ignore the comment and count the lines with real code.
CLOC is a linux program that everyone uses,
but i found for my projects it has some issues
specilally when multiple languages are used.
This python program's output was modelled much like the original cloc.
If you don't like this program, the original CLOC by AlDanial
may just suit your needs: https://github.com/AlDanial/cloc
Program: clocpy
Author: Henk Speksnijder
Date 14 july 2018
Licence: MIT
Default it does NOT report binary files.
-b = do report the binary files.
Default it does not recurse subdirectories.
-r = recurse into subdirectories
clocpy detect these variants:
- bash
see txt
- julia
whitespace = space, tab
comment one line = #
comment multi line start= #=
comment multi line stop = =#
- nim
whitespace = space, tab
comment one line = #
comment multi line start= #[
comment multi line stop = ]#
- python
whitespace = space, tab
comment one line = #
comment multi line start= triple quote
comment multi line stop = triple quote
- pascal
whitespace = space, tab
comment one line = //
comment multi line start= ( /old, not accepted/
comment multi line stop = ) /old, not accepted/
comment multi line start= {
comment multi line stop = }
Note something like {mode}{H+} is counted as code !
- c++
whitespace = space, tab
comment one line = //
comment multi line start= /
comment multi line stop = /
- txt
whitespace = space, tab
comment one line = #
comment multi line start= NoMultilineComment
comment multi line stop = NoMultilineComment
20180714 added scanning multi-line comment for julia and nim.
20151225 finally exactly the same result from all 4 versions.
Henk Speksnijder 20171118