Skip to content

Commit cf64c5f

Browse files
ZviBaratzclaude
andcommitted
fix(ego-lint): fix ARROW_FN_DEF regex and test assertions
The arrow function exemption in check-init.py never fired due to Python implicit string concatenation producing `=(?:` instead of `=\s*(?:` — missing whitespace match between assignment and params. Also fix test assertions: swap descriptions to match their patterns, and replace vacuous `getMonitors` pattern (source content never appears in ego-lint output) with `extension.js:8` (actual line number). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent db04d84 commit cf64c5f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def is_skip_line(line):
6464
# Arrow function definitions: the body after => is lazy (not executed at
6565
# module scope). Detect `const fn = (...) => expr` patterns.
6666
ARROW_FN_DEF = re.compile(
67-
r'(?:const|let|var)\s+\w+\s*=' # variable assignment
67+
r'(?:const|let|var)\s+\w+\s*=\s*' # variable assignment
6868
r'(?:\([^)]*\)|\w+)' # parameter list or single param
6969
r'\s*=>' # arrow
7070
)

tests/run-tests.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ echo "=== init-time-safety ==="
196196
run_lint "init-time-safety@test"
197197
assert_exit_code "exits with 1 (has module-scope violation)" 1
198198
assert_output_contains "fails on module-scope Main access" "\[FAIL\].*init/shell-modification"
199-
assert_output_not_contains "no FP on arrow function definition" "init/shell-modification.*helper.js"
200-
assert_output_not_contains "no FP on helper constructor" "init/shell-modification.*getMonitors"
199+
assert_output_not_contains "no FP on helper constructor" "init/shell-modification.*helper.js"
200+
assert_output_not_contains "no FP on arrow function definition" "init/shell-modification.*extension.js:8"
201201
echo ""
202202

203203
# --- lifecycle-imbalance ---

0 commit comments

Comments
 (0)