@willbooster/wb 22.18.0 → 22.20.0

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.
Files changed (3) hide show
  1. package/README.md +25 -0
  2. package/dist/index.js +54 -54
  3. package/package.json +5 -4
package/README.md CHANGED
@@ -19,6 +19,8 @@ Commands:
19
19
  WB_ENV. Prefix scripts that write to remote
20
20
  environments with this command to fail fast on
21
21
  missing secrets.
22
+ wb code-gauge Print code-gauge errors and warnings without
23
+ failing
22
24
  wb concurrently <commands...> Run commands concurrently
23
25
  wb deploy Deploy to the WB_ENV environment. A Cloudflare
24
26
  Workers app (vinext or plain Worker): validate
@@ -185,6 +187,29 @@ A package whose `package.json` defines a `test/post` script gets a `post` phase:
185
187
 
186
188
  For `wb verify` and `wb verify --full`, a log-write failure falls back to printing subsequent raw output. If a log cannot be completed, the command reports the log error and fails an otherwise successful run; an existing nonzero command exit status is preserved.
187
189
 
190
+ ## Code-quality checks
191
+
192
+ `wb code-gauge` runs [`code-gauge check`](https://github.com/WillBooster/code-gauge#threshold-check-code-gauge-check)
193
+ on the project and prints every threshold violation as an error or a warning: functions and files
194
+ over a metric limit, and duplicated blocks. `--base <ref>` limits them to what the working tree
195
+ changed since the merge-base with `<ref>`. The command always exits with 0, including when there
196
+ are errors or the check cannot complete.
197
+
198
+ ```sh
199
+ bun wb code-gauge
200
+ bun wb code-gauge --base origin/HEAD
201
+ ```
202
+
203
+ `wb verify` and `wb verify --full` run the same check as their `code-gauge` step and print the
204
+ violations after the recap: the totals per level, how many are in code changed since the merge-base
205
+ with `origin/HEAD`, and at most 10 violations: those in the changed code first, then the rest, each
206
+ group with its errors before its warnings. A limit milder than its line's level names its own, as in
207
+ `error: ... function cognitive complexity 56 (max 30), function ncss 61 (warning max 60)`. The step
208
+ never fails verification.
209
+
210
+ wb uses its own `code-gauge` and code-gauge's default thresholds; a `code-gauge.config.json` in the
211
+ repository overrides them.
212
+
188
213
  ## Slidev checks
189
214
 
190
215
  `wb slidev-check` checks slide text with textlint, then checks rendered Slidev decks.