MIL-010 task 6: reusable workflow code-metrics.yml and tools/code-metrics.sh

Task: MIL-010#6
Refs #160
This commit is contained in:
2026-10-14 13:50:34 +08:00
parent 5bc14d789d
commit 4fc0a8cab3
5 changed files with 526 additions and 0 deletions
+7
View File
@@ -280,3 +280,10 @@ class TestMain:
code = badges.main(["--metrics", str(bad), "--output-dir", str(tmp_path / "o")])
assert code == 1
assert "cannot be read" in capsys.readouterr().out
def test_no_code_files_is_a_notice_and_badges_that_show_zero(self, tmp_path, capsys):
out = tmp_path / "out"
metrics = metrics_file(tmp_path, files=0, lines=0)
assert badges.main(["--metrics", str(metrics), "--output-dir", str(out)]) == 0
assert "::notice::No code files were found" in capsys.readouterr().out
assert 'aria-label="code files: 0"' in (out / "code-files.svg").read_text()