Skip to content

Commit 3e45626

Browse files
ZviBaratzclaude
andcommitted
fix(ego-lint): sync check-resources.py reason strings with build-resource-graph.py
build-resource-graph.py changed its reason strings when adding onDestroy() support, but check-resources.py still matched the old substrings. This caused orphan classification for no-destroy-method and destroy-not-called to silently fall through to the generic type-based routing. Also strengthens the on-destroy-cleanup test with a positive assertion that resource tracking actually ran, preventing vacuous negative passes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 8b00575 commit 3e45626

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

skills/ego-lint/scripts/check-resources.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ def classify_orphan(orphan):
5252
file_path = orphan.get('file', '')
5353
line = orphan.get('line', '?')
5454

55-
# Case 1: No destroy/disable method at all
56-
if 'no destroy()/disable() method' in reason:
55+
# Case 1: No cleanup method at all (destroy/disable/onDestroy)
56+
if 'no cleanup method' in reason:
5757
detail = f"{file_path}:{line}{reason}"
5858
return 'resource-tracking/no-destroy-method', detail
5959

60-
# Case 2: Parent doesn't call destroy
61-
if 'parent does not call destroy()' in reason:
60+
# Case 2: Parent doesn't call cleanup method
61+
if 'parent does not call cleanup method' in reason:
6262
detail = f"{file_path}:{line}{reason}"
6363
return 'resource-tracking/destroy-not-called', detail
6464

tests/run-tests.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,8 @@ echo ""
609609
echo "=== on-destroy-cleanup ==="
610610
run_lint "on-destroy-cleanup@test"
611611
assert_exit_code "exits with 0 (no blocking issues)" 0
612-
assert_output_not_contains "onDestroy recognized as cleanup method" "\[WARN\].*resource-tracking/no-destroy-method.*widget"
612+
assert_output_not_contains "no no-destroy-method for widget with onDestroy" "\[WARN\].*resource-tracking/no-destroy-method.*widget"
613+
assert_output_contains "resource tracking ran" "(PASS|WARN|FAIL).*resource-tracking"
613614
echo ""
614615

615616
# Extended assertion files (auto-sourced from assertions/ directory)

0 commit comments

Comments
 (0)