safeword 0.4.2 → 0.4.3
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
CHANGED
|
@@ -13,7 +13,7 @@ file=$(echo "$input" | jq -r '.tool_input.file_path // .tool_input.notebook_path
|
|
|
13
13
|
|
|
14
14
|
# Determine linters based on file extension
|
|
15
15
|
case "$file" in
|
|
16
|
-
*.js|*.jsx|*.ts|*.tsx|*.mjs|*.cjs|*.astro)
|
|
16
|
+
*.js|*.jsx|*.ts|*.tsx|*.mjs|*.cjs|*.astro|*.vue)
|
|
17
17
|
# Prettier (silent, ignore errors)
|
|
18
18
|
npx prettier --write "$file" 2>/dev/null
|
|
19
19
|
|
|
@@ -38,6 +38,30 @@ case "$file" in
|
|
|
38
38
|
# Prettier only (silent, ignore errors)
|
|
39
39
|
npx prettier --write "$file" 2>/dev/null
|
|
40
40
|
;;
|
|
41
|
+
|
|
42
|
+
*.py)
|
|
43
|
+
# Python: ruff format + ruff check --fix (silent, capture unfixable)
|
|
44
|
+
npx ruff format "$file" 2>/dev/null
|
|
45
|
+
errors=$(npx ruff check --fix "$file" 2>&1)
|
|
46
|
+
exit_code=$?
|
|
47
|
+
if [ $exit_code -ne 0 ] && [ -n "$errors" ]; then
|
|
48
|
+
echo "$errors"
|
|
49
|
+
fi
|
|
50
|
+
;;
|
|
51
|
+
|
|
52
|
+
*.go)
|
|
53
|
+
# Go: gofmt (silent, capture errors)
|
|
54
|
+
if command -v gofmt &> /dev/null; then
|
|
55
|
+
gofmt -w "$file" 2>/dev/null
|
|
56
|
+
fi
|
|
57
|
+
;;
|
|
58
|
+
|
|
59
|
+
*.rs)
|
|
60
|
+
# Rust: rustfmt (silent, capture errors)
|
|
61
|
+
if command -v rustfmt &> /dev/null; then
|
|
62
|
+
rustfmt "$file" 2>/dev/null
|
|
63
|
+
fi
|
|
64
|
+
;;
|
|
41
65
|
esac
|
|
42
66
|
|
|
43
67
|
exit 0
|