flowbber.plugins.sources.sloc
¶This source count source lines of code. It scans a directory for source code files, identify their language and count the number of code, comments and empty lines. It is highly tunable using include and exclude patterns as explained below. It is implemented on top of pygount, which is very accurate, but not the fastest. Benchmark on HUGE code bases.
Data collected:
{
"sloc": {
"html": {
"string": 0,
"empty": 59,
"code": 129,
"documentation": 7
},
"python": {
"string": 362,
"empty": 1532,
"code": 2262,
"documentation": 4291
},
"restructuredtext": {
"string": 73,
"empty": 619,
"code": 1133,
"documentation": 19
},
},
"files": {
"setup.py": "python",
"lib/flowbber/main.py": "python",
"... more collected files ...": "<language detected>"
}
}
Dependencies:
pip3 install flowbber[sloc]
Usage:
[[sources]]
type = "sloc"
id = "..."
[sources.config]
directory = "{git.root}"
include = ["*"]
exclude = []
{
"sources": [
{
"type": "sloc",
"id": "...",
"config": {
"directory": "{git.root}",
"include": ["*"],
"exclude": []
}
}
]
}
Root directory to search for files.
Default: '.'
Optional: True
Schema:
{
'type': 'string',
'empty': False,
}
Secret: False
SLOCSource
:
Main base class to implement a Source.flowbber.plugins.sources.sloc.
SLOCSource
(index, type_, id_, optional=False, timeout=None, config=None)¶Inheritance