wily
wily copied to clipboard
Generate JSON output
This proof of concept adds a --json
option to diff, index, rank and report, allowing to generate output in JSON format.
Example output (excerpt from wily report -n 11 --json src\wily\commands\report.py
):
[
{
"Revision": "f1e8225",
"Author": "Anthony Shaw",
"Date": "2023-03-12",
"Cyclomatic Complexity": "24 (0)",
"Unique Operands": "8 (0)",
"Maintainability Index": "56.8982 (0.0)",
"Lines of Code": "206 (0)"
},
{
"Revision": "e9921dd",
"Author": "Christian Clauss",
"Date": "2023-03-11",
"Cyclomatic Complexity": "24 (0)",
"Unique Operands": "8 (0)",
"Maintainability Index": "56.8982 (0)",
"Lines of Code": "206 (0)"
}
]
Pasting this here I just realized it might be a good idea to add file name to each JSON entry. Oh well, back to the drawing board.
Still needs tests and docstring updates.
Fixes part of #92.