Skip to content

Commit d19ef96

Browse files
committed
Dedupe symlink limitation and align test fixture (GH-495)
The generic multi_skill_symlinked_entry aggregate message duplicated the clearer symlink omission text for the same entries; keep only the clearer one when the omission counter covers it. Build the aggregate test fixture the way real discovery does since #499, with both the limitation and the counter, and assert the generic text is absent. Signed-off-by: Coccinella Labs <[email protected]>
1 parent e91f1e7 commit d19ef96

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

‎src/skillspector/cli.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2710,6 +2710,10 @@ def _scan_multi_skill(
27102710
aggregate_limitations = [
27112711
f"recursive discovery {limitation.resource} limit reached"
27122712
for limitation in detection.limitations[:256]
2713+
# Symlink omissions get their own clearer aggregate message below;
2714+
# listing the generic one too would double-report the same entries.
2715+
if limitation.resource != "multi_skill_symlinked_entry"
2716+
or not detection.omitted_symlink_entries
27132717
]
27142718
retained_public_records = 0
27152719
retained_report_characters = 0

‎tests/unit/test_cli.py‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1865,6 +1865,12 @@ def test_recursive_symlinked_skills_are_reported_as_omitted(
18651865
detection = MultiSkillDetectionResult(
18661866
is_multi_skill=True,
18671867
skills=[skill],
1868+
limitations=(
1869+
MultiSkillDetectionLimitation(
1870+
reason_code="read_error",
1871+
resource="multi_skill_symlinked_entry",
1872+
),
1873+
),
18681874
omitted_symlink_entries=1,
18691875
)
18701876
output = tmp_path / "combined.json"
@@ -1888,6 +1894,10 @@ def test_recursive_symlinked_skills_are_reported_as_omitted(
18881894
"symlinked recursive skill(s) omitted" in limitation
18891895
for limitation in payload["analysis_completeness"]["limitations"]
18901896
)
1897+
assert not any(
1898+
"multi_skill_symlinked_entry limit reached" in limitation
1899+
for limitation in payload["analysis_completeness"]["limitations"]
1900+
)
18911901
assert payload["skills"][-1] == {
18921902
"omitted": True,
18931903
"omitted_count": 1,

0 commit comments

Comments
 (0)