fix(ratchet): refuse a package directory that does not exist
CI / test (3.11) (pull_request) Successful in 27s
CI / test (3.12) (pull_request) Successful in 24s
CI / test (3.13) (pull_request) Successful in 23s

napalm-hpe-aruba-procurve ships napalm_procurve; guessed from its name, the
ratchet measured nothing and wrote an empty baseline without a word.
This commit is contained in:
christianmanivong committed 2026-10-23 08:49:47 +02:00
1 parent a4858e9a1f
commit c3151d62fa
5 files changed
+33 -1

No files matched your search

+4
View File
@@ -152,6 +152,10 @@ def _lines(source: str) -> int:
def measure(repo: pathlib.Path, package: str) -> dict[str, Any]:
"""Today's excesses, keyed the way the baseline stores them."""
if not (repo / package).is_dir():
raise FileNotFoundError(
f"no package directory {package}/ to measure; name it in [tool.napalm-standard] package"
)
function_lines: dict[str, int] = {}
function_complexity: dict[str, int] = {}
python_file_lines: dict[str, int] = {}