agentic-loop 3.4.6 → 3.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/ralph/verify/lint.sh +20 -11
package/package.json
CHANGED
package/ralph/verify/lint.sh
CHANGED
|
@@ -3,18 +3,27 @@
|
|
|
3
3
|
# lint.sh - Lint and auto-fix verification module for ralph
|
|
4
4
|
|
|
5
5
|
# Auto-fix lint issues before running checks
|
|
6
|
+
# Usage: run_auto_fix [story_type]
|
|
6
7
|
run_auto_fix() {
|
|
8
|
+
local story_type="${1:-general}"
|
|
7
9
|
echo " Auto-fixing lint issues..."
|
|
8
10
|
|
|
9
|
-
# Python: ruff fix (
|
|
10
|
-
if
|
|
11
|
-
|
|
11
|
+
# Python: ruff fix (skip for frontend-only stories)
|
|
12
|
+
if [[ "$story_type" != "frontend" ]]; then
|
|
13
|
+
if command -v ruff &>/dev/null; then
|
|
14
|
+
ruff check --fix . >/dev/null 2>&1 || true
|
|
15
|
+
fi
|
|
16
|
+
fi
|
|
17
|
+
|
|
18
|
+
# Skip JS/TS auto-fix for backend stories
|
|
19
|
+
if [[ "$story_type" == "backend" ]]; then
|
|
20
|
+
return 0
|
|
12
21
|
fi
|
|
13
22
|
|
|
14
|
-
# JavaScript/TypeScript: eslint fix (root)
|
|
23
|
+
# JavaScript/TypeScript: eslint fix (root) - suppress all output
|
|
15
24
|
if [[ -f "package.json" ]] && command -v npx &>/dev/null; then
|
|
16
25
|
if grep -q '"eslint"' package.json 2>/dev/null || [[ -f ".eslintrc.js" ]] || [[ -f "eslint.config.js" ]]; then
|
|
17
|
-
npx eslint --fix .
|
|
26
|
+
npx eslint --fix . >/dev/null 2>&1 || true
|
|
18
27
|
fi
|
|
19
28
|
fi
|
|
20
29
|
|
|
@@ -25,25 +34,25 @@ run_auto_fix() {
|
|
|
25
34
|
while IFS= read -r fe_dir; do
|
|
26
35
|
[[ -z "$fe_dir" ]] && continue
|
|
27
36
|
[[ ! -f "$fe_dir/package.json" ]] && continue
|
|
28
|
-
# ESLint fix
|
|
37
|
+
# ESLint fix - suppress output
|
|
29
38
|
if grep -q '"eslint"' "$fe_dir/package.json" 2>/dev/null; then
|
|
30
|
-
(cd "$fe_dir" && npx eslint --fix .
|
|
39
|
+
(cd "$fe_dir" && npx eslint --fix . >/dev/null 2>&1) || true
|
|
31
40
|
fi
|
|
32
41
|
|
|
33
42
|
# Next.js lint fix
|
|
34
43
|
if grep -q '"next"' "$fe_dir/package.json" 2>/dev/null; then
|
|
35
|
-
(cd "$fe_dir" && npx next lint --fix
|
|
44
|
+
(cd "$fe_dir" && npx next lint --fix >/dev/null 2>&1) || true
|
|
36
45
|
fi
|
|
37
46
|
|
|
38
47
|
# Prettier fix (common in frontend)
|
|
39
48
|
if grep -q '"prettier"' "$fe_dir/package.json" 2>/dev/null; then
|
|
40
|
-
(cd "$fe_dir" && npx prettier --write .
|
|
49
|
+
(cd "$fe_dir" && npx prettier --write . >/dev/null 2>&1) || true
|
|
41
50
|
fi
|
|
42
51
|
done <<< "$fe_dirs"
|
|
43
52
|
|
|
44
53
|
# Prettier fix (root - for non-monorepo)
|
|
45
54
|
if [[ -f "package.json" ]] && grep -q '"prettier"' package.json 2>/dev/null; then
|
|
46
|
-
npx prettier --write .
|
|
55
|
+
npx prettier --write . >/dev/null 2>&1 || true
|
|
47
56
|
fi
|
|
48
57
|
}
|
|
49
58
|
|
|
@@ -461,7 +470,7 @@ run_configured_checks() {
|
|
|
461
470
|
local story_type="${1:-general}"
|
|
462
471
|
|
|
463
472
|
# ALWAYS run auto-fix (harmless, just formats code)
|
|
464
|
-
run_auto_fix
|
|
473
|
+
run_auto_fix "$story_type"
|
|
465
474
|
|
|
466
475
|
# Lint check - skip irrelevant checks based on story type
|
|
467
476
|
if check_enabled "lint"; then
|