Skip to content

Commit e91f1e7

Browse files
committed
Count symlink omissions in aggregate coverage total (GH-495)
Omitted links were added to omitted_skills while total_skills counted only real children, reporting full coverage with uninspected files. Include the symlink omission count in the denominator and assert the corrected totals in the aggregate test. Also drop the now-unreachable duplicate _SKIP_DIRS check inside the symlink branch, keeping the explanatory comment with the surviving loop-top check. Signed-off-by: Coccinella Labs <[email protected]>
1 parent 16a1c54 commit e91f1e7

3 files changed

Lines changed: 10 additions & 9 deletions

File tree

‎src/skillspector/cli.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2869,7 +2869,7 @@ def _scan_multi_skill(
28692869
)
28702870
aggregate_limitations = list(dict.fromkeys(aggregate_limitations))[:256]
28712871
aggregate_completeness = _multi_skill_analysis_completeness(
2872-
total_skills=len(skills),
2872+
total_skills=len(skills) + omitted_symlink_entry_count,
28732873
complete_skills=complete_skill_count,
28742874
partial_skills=partial_skill_count,
28752875
failed_skills=failed_skill_count,

‎src/skillspector/multi_skill.py‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -283,17 +283,15 @@ def detect_skills(directory: Path) -> MultiSkillDetectionResult:
283283
budget.check_runtime()
284284
child = Path(entry.path)
285285
if entry.name in _SKIP_DIRS:
286+
# Intentionally ignored names (e.g. `.git`, `.venv`,
287+
# `node_modules`) are not a discovery gap even when they are
288+
# symlinks; skip them before recording any limitation. Any
289+
# other symlinked name is recorded below, so an eligible
290+
# dot-prefixed skill such as `.review-helper` is never
291+
# silently excluded.
286292
continue
287293
try:
288294
if entry.is_symlink() or _is_link_or_junction(child):
289-
if entry.name in _SKIP_DIRS:
290-
# Intentionally ignored names (e.g. `.git`, `.venv`,
291-
# `node_modules`) are not a discovery gap even when
292-
# they are symlinks; skip them before recording the
293-
# symlink limitation. Any other symlinked name is
294-
# recorded below, so an eligible dot-prefixed skill
295-
# such as `.review-helper` is never silently excluded.
296-
continue
297295
limitations.append(
298296
MultiSkillDetectionLimitation(
299297
reason_code="read_error",

‎tests/unit/test_cli.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1880,6 +1880,9 @@ def test_recursive_symlinked_skills_are_reported_as_omitted(
18801880
assert payload["skills_scanned"] == 1
18811881
assert payload["skills_omitted"] == 1
18821882
assert payload["analysis_completeness"]["is_complete"] is False
1883+
assert payload["analysis_completeness"]["total_files"] == 2
1884+
assert payload["analysis_completeness"]["coverage_percent"] == 50.0
1885+
assert payload["analysis_completeness"]["entirely_uninspected_files"] == 1
18831886
assert payload["risk_recommendation"] == "CAUTION"
18841887
assert any(
18851888
"symlinked recursive skill(s) omitted" in limitation

0 commit comments

Comments
 (0)