unslop 0.1.4 → 0.1.5
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/README.md +68 -41
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -42,6 +42,9 @@ unslop --format json .
|
|
|
42
42
|
# SARIF output (for CI integration)
|
|
43
43
|
unslop --format sarif .
|
|
44
44
|
|
|
45
|
+
# List built-in rules and defaults
|
|
46
|
+
unslop --list-rules
|
|
47
|
+
|
|
45
48
|
# With config file
|
|
46
49
|
unslop --config .unslop.yaml .
|
|
47
50
|
```
|
|
@@ -68,18 +71,20 @@ Use `--changed-only` to focus on uncommitted files and prioritize reuse against
|
|
|
68
71
|
| Dead exports | Clone | 95% |
|
|
69
72
|
| Complexity budget breaches | Practices | 90% |
|
|
70
73
|
| Boundary violations (`packages -> apps`, cross-app deps, cycles) | Practices | 90-98% |
|
|
71
|
-
| Generic naming entropy | Practices | 74% |
|
|
72
74
|
| Ignored Go errors | Practices | 93% |
|
|
73
75
|
| Go context leaks | Practices | 87% |
|
|
74
76
|
| React broad barrel re-exports | Practices | 78-86% |
|
|
75
77
|
|
|
76
78
|
## Architecture
|
|
77
79
|
|
|
78
|
-
|
|
80
|
+
Four artifact engines run in parallel and are evaluated through a rule catalog:
|
|
79
81
|
|
|
80
82
|
1. **Clone Detection** (in-process) — tree-sitter parsing → pre-normalization (cached) → alpha-renaming → hash/suffix-tree/PQ-gram comparison
|
|
81
|
-
2. **Semantic Analysis** (subprocess) —
|
|
82
|
-
3. **Best Practices** (in-process) — deterministic clean-code and architecture checks
|
|
83
|
+
2. **Semantic Analysis** (subprocess) — external linter diagnostics
|
|
84
|
+
3. **Best Practices** (in-process) — deterministic clean-code and architecture checks
|
|
85
|
+
4. **Repo Policy** (in-process) — repository policy signals
|
|
86
|
+
|
|
87
|
+
Each rule is now a first-class catalog entry with defaults and per-rule controls.
|
|
83
88
|
|
|
84
89
|
Built on Semgrep's model: **tree-sitter CST → language-specific normalizer → generic normalized tree → language-agnostic analysis**.
|
|
85
90
|
|
|
@@ -106,52 +111,74 @@ SDK stability policy: `pkg/sdk/STABILITY.md`.
|
|
|
106
111
|
|
|
107
112
|
## Configuration
|
|
108
113
|
|
|
109
|
-
Create `.unslop.yaml` in your project root:
|
|
114
|
+
Create `.unslop.yaml` in your project root. v2 requires `version: 2`:
|
|
110
115
|
|
|
111
116
|
```yaml
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
117
|
+
version: 2
|
|
118
|
+
|
|
119
|
+
analysis:
|
|
120
|
+
ignore:
|
|
121
|
+
- "vendor/"
|
|
122
|
+
- "node_modules/"
|
|
123
|
+
extensions: [".ts", ".tsx", ".go"]
|
|
124
|
+
languages: ["typescript", "go"]
|
|
125
|
+
changed_only: false
|
|
126
|
+
|
|
127
|
+
engines:
|
|
128
|
+
clone:
|
|
129
|
+
min_tokens: 50
|
|
130
|
+
similarity_threshold: 0.8
|
|
131
|
+
max_suffix_pairs: 10000
|
|
132
|
+
max_pqgram_pairs: 50000
|
|
133
|
+
linters:
|
|
134
|
+
oxlint:
|
|
135
|
+
enabled: true
|
|
136
|
+
command: oxlint
|
|
137
|
+
args: ["--format", "json"]
|
|
138
|
+
timeout: "60s"
|
|
139
|
+
practices:
|
|
127
140
|
enabled: true
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
141
|
+
profile: balanced
|
|
142
|
+
ignore_tests: true
|
|
143
|
+
max_findings_per_rule: 200
|
|
144
|
+
|
|
145
|
+
rules:
|
|
146
|
+
defaults:
|
|
147
|
+
severity: warning
|
|
148
|
+
gateable: false
|
|
149
|
+
exact-clone:
|
|
150
|
+
severity: error
|
|
151
|
+
gateable: true
|
|
152
|
+
barrel-import:
|
|
153
|
+
enabled: false
|
|
154
|
+
complexity-budget:
|
|
155
|
+
paths:
|
|
156
|
+
include: ["apps/**"]
|
|
157
|
+
exclude: ["scripts/**"]
|
|
158
|
+
|
|
159
|
+
gates:
|
|
160
|
+
max_score: 35
|
|
161
|
+
fail_on_rules: ["exact-clone", "boundary-violation-cycle"]
|
|
162
|
+
fail_on_tiers: ["A"]
|
|
136
163
|
|
|
137
|
-
# Slop score configuration
|
|
138
164
|
slop_score:
|
|
139
|
-
# strict | balanced | lenient
|
|
140
165
|
profile: balanced
|
|
141
|
-
# number of top contributors shown in terminal output (1-10)
|
|
142
166
|
top_contributors: 5
|
|
143
|
-
|
|
144
|
-
# Best-practices configuration
|
|
145
|
-
best_practices:
|
|
146
|
-
enabled: true
|
|
147
|
-
# strict | balanced | lenient
|
|
148
|
-
profile: balanced
|
|
149
|
-
# ignore test-like paths for best-practices findings
|
|
150
|
-
ignore_tests: true
|
|
151
|
-
# deterministic per-rule cap (20-1000)
|
|
152
|
-
max_findings_per_rule: 200
|
|
153
167
|
```
|
|
154
168
|
|
|
169
|
+
See `/Users/danieledeling/projects/go/unslop/docs/config-v2.md` and `/Users/danieledeling/projects/go/unslop/docs/rules.md` for full details.
|
|
170
|
+
|
|
171
|
+
## v2 Breaking Change
|
|
172
|
+
|
|
173
|
+
Configuration is now strict v2:
|
|
174
|
+
|
|
175
|
+
- `version: 2` is required when using a config file
|
|
176
|
+
- unknown top-level keys fail parsing
|
|
177
|
+
- unknown non-legacy rule IDs fail parsing
|
|
178
|
+
- removed legacy rule IDs are silently ignored in config/CLI rule selectors
|
|
179
|
+
- unknown fields under `rules.<id>` fail parsing
|
|
180
|
+
- there is no v1 compatibility bridge
|
|
181
|
+
|
|
155
182
|
Example terminal section (`--verbose`):
|
|
156
183
|
|
|
157
184
|
```text
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unslop",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "Detect duplicated code, dead code, and anti-patterns in AI-generated codebases",
|
|
5
5
|
"bin": {
|
|
6
6
|
"unslop": "bin.js"
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
"bin.js"
|
|
10
10
|
],
|
|
11
11
|
"optionalDependencies": {
|
|
12
|
-
"@unslop/darwin-arm64": "0.1.
|
|
13
|
-
"@unslop/darwin-x64": "0.1.
|
|
14
|
-
"@unslop/linux-arm64": "0.1.
|
|
15
|
-
"@unslop/linux-x64": "0.1.
|
|
16
|
-
"@unslop/win32-x64": "0.1.
|
|
12
|
+
"@unslop/darwin-arm64": "0.1.5",
|
|
13
|
+
"@unslop/darwin-x64": "0.1.5",
|
|
14
|
+
"@unslop/linux-arm64": "0.1.5",
|
|
15
|
+
"@unslop/linux-x64": "0.1.5",
|
|
16
|
+
"@unslop/win32-x64": "0.1.5"
|
|
17
17
|
},
|
|
18
18
|
"license": "Apache-2.0",
|
|
19
19
|
"repository": {
|