Report lines of code and the main languages from cloc.txt
The project page takes the size from cloc's sum and names the three to five largest languages, leaving out prose and data files such as Markdown, text, CSV and JSON, and anything under 1% of the code beyond the third. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9d78e9edf4
commit
2d88ffa953
4 files changed
+121
-15
No files matched your search
@@ -16,6 +16,7 @@ from typing import TYPE_CHECKING, Any
|
||||
from .vendor.cc_common.api import PipelineError
|
||||
from .vendor.cc_common.api import context as logging_context
|
||||
|
||||
from .cloc import parse_cloc
|
||||
from .context import build_context
|
||||
from .layout import render_pdf
|
||||
|
||||
@@ -72,6 +73,7 @@ def render(
|
||||
"""
|
||||
documents = {name: _parsed(sources, name, candidates) for name, candidates in INPUTS.items()}
|
||||
documents["metrics"] = metrics
|
||||
documents["cloc"] = parse_cloc(sources.first("cloc.txt"))
|
||||
if all(documents.get(name) is None for name in REQUIRED_ANY):
|
||||
message = f"Scan {sources.scan_id} carries no {' and no '.join(REQUIRED_ANY)}, so no report can be built."
|
||||
|
||||
|
||||
Reference in new issue
Block a user