safeword 0.15.1 → 0.15.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 +2 -2
- package/templates/commands/audit.md +21 -14
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "safeword",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.3",
|
|
4
4
|
"description": "CLI for setting up and managing safeword development environments",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"commander": "^12.1.0",
|
|
36
|
-
"eslint-plugin-safeword": "^0.
|
|
36
|
+
"eslint-plugin-safeword": "^0.7.0",
|
|
37
37
|
"yaml": "^2.7.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
@@ -9,24 +9,31 @@ Run a comprehensive code audit. Execute these commands and report results.
|
|
|
9
9
|
## Instructions
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
#
|
|
13
|
-
|
|
12
|
+
# =========================================================================
|
|
13
|
+
# REFRESH CONFIG (detect current architecture)
|
|
14
|
+
# =========================================================================
|
|
15
|
+
|
|
16
|
+
# 0. Regenerate depcruise config from current project structure
|
|
17
|
+
bunx safeword@latest sync-config 2>&1 || true
|
|
14
18
|
|
|
15
19
|
# =========================================================================
|
|
16
20
|
# ARCHITECTURE CHECKS (circular deps, layer violations)
|
|
17
21
|
# =========================================================================
|
|
18
22
|
|
|
19
|
-
#
|
|
20
|
-
|
|
21
|
-
|
|
23
|
+
# 1a. Architecture - TypeScript/JS (depcruise)
|
|
24
|
+
DEPCRUISE_CONFIG=""
|
|
25
|
+
[ -f .dependency-cruiser.cjs ] && DEPCRUISE_CONFIG=".dependency-cruiser.cjs"
|
|
26
|
+
[ -f .dependency-cruiser.js ] && DEPCRUISE_CONFIG=".dependency-cruiser.js"
|
|
27
|
+
[ -n "$DEPCRUISE_CONFIG" ] && {
|
|
28
|
+
bunx depcruise --output-type err --config "$DEPCRUISE_CONFIG" . 2>&1 || true
|
|
22
29
|
}
|
|
23
30
|
|
|
24
|
-
#
|
|
31
|
+
# 1b. Architecture - Python
|
|
25
32
|
# Note: Python circular imports cause ImportError at runtime.
|
|
26
33
|
# If your Python code runs, it has no blocking circular imports.
|
|
27
34
|
# For static analysis, consider: pip install import-linter
|
|
28
35
|
|
|
29
|
-
#
|
|
36
|
+
# 1c. Architecture - Go
|
|
30
37
|
# Note: Go compiler prevents circular imports between packages at build time.
|
|
31
38
|
# If your Go project builds, it has no circular dependencies.
|
|
32
39
|
|
|
@@ -34,17 +41,17 @@ bunx safeword sync-config 2>&1
|
|
|
34
41
|
# DEAD CODE DETECTION
|
|
35
42
|
# =========================================================================
|
|
36
43
|
|
|
37
|
-
#
|
|
44
|
+
# 2a. Dead code - TypeScript/JS (knip with auto-fix)
|
|
38
45
|
[ -f package.json ] && {
|
|
39
46
|
bunx knip --fix 2>&1 || true
|
|
40
47
|
}
|
|
41
48
|
|
|
42
|
-
#
|
|
49
|
+
# 2b. Dead code - Python (deadcode)
|
|
43
50
|
([ -f pyproject.toml ] || [ -f requirements.txt ]) && {
|
|
44
51
|
deadcode . 2>&1 || true
|
|
45
52
|
}
|
|
46
53
|
|
|
47
|
-
#
|
|
54
|
+
# 2c. Dead code - Go (golangci-lint unused)
|
|
48
55
|
[ -f go.mod ] && {
|
|
49
56
|
golangci-lint run --enable unused --out-format colored-line-number 2>&1 || true
|
|
50
57
|
}
|
|
@@ -53,24 +60,24 @@ bunx safeword sync-config 2>&1
|
|
|
53
60
|
# CODE DUPLICATION
|
|
54
61
|
# =========================================================================
|
|
55
62
|
|
|
56
|
-
#
|
|
63
|
+
# 3. Copy/paste detection (all languages)
|
|
57
64
|
bunx jscpd . --gitignore --min-lines 10 --reporters console 2>&1 || true
|
|
58
65
|
|
|
59
66
|
# =========================================================================
|
|
60
67
|
# OUTDATED DEPENDENCIES
|
|
61
68
|
# =========================================================================
|
|
62
69
|
|
|
63
|
-
#
|
|
70
|
+
# 4a. Outdated - TypeScript/JS
|
|
64
71
|
[ -f package.json ] && {
|
|
65
72
|
bun outdated 2>&1 || npm outdated 2>&1 || true
|
|
66
73
|
}
|
|
67
74
|
|
|
68
|
-
#
|
|
75
|
+
# 4b. Outdated - Python (uv > poetry > pip)
|
|
69
76
|
([ -f pyproject.toml ] || [ -f requirements.txt ]) && {
|
|
70
77
|
uv pip list --outdated 2>&1 || poetry show --outdated 2>&1 || pip list --outdated 2>&1 || true
|
|
71
78
|
}
|
|
72
79
|
|
|
73
|
-
#
|
|
80
|
+
# 4c. Outdated - Go
|
|
74
81
|
[ -f go.mod ] && {
|
|
75
82
|
go list -m -u all 2>&1 | grep '\[' || echo "All Go modules up to date"
|
|
76
83
|
}
|