safeword 0.4.2 → 0.4.4

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "safeword",
3
- "version": "0.4.2",
3
+ "version": "0.4.4",
4
4
  "description": "CLI for setting up and managing safeword development environments",
5
5
  "type": "module",
6
6
  "bin": {
@@ -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|*.svelte)
17
17
  # Prettier (silent, ignore errors)
18
18
  npx prettier --write "$file" 2>/dev/null
19
19
 
@@ -38,6 +38,32 @@ 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
44
+ if command -v ruff &> /dev/null; then
45
+ ruff format "$file" 2>/dev/null
46
+ errors=$(ruff check --fix "$file" 2>&1)
47
+ exit_code=$?
48
+ if [ $exit_code -ne 0 ] && [ -n "$errors" ]; then
49
+ echo "$errors"
50
+ fi
51
+ fi
52
+ ;;
53
+
54
+ *.go)
55
+ # Go: gofmt
56
+ if command -v gofmt &> /dev/null; then
57
+ gofmt -w "$file" 2>/dev/null
58
+ fi
59
+ ;;
60
+
61
+ *.rs)
62
+ # Rust: rustfmt
63
+ if command -v rustfmt &> /dev/null; then
64
+ rustfmt "$file" 2>/dev/null
65
+ fi
66
+ ;;
41
67
  esac
42
68
 
43
69
  exit 0