@willbooster/wb 23.5.2 → 23.6.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 +11 -7
  2. package/dist/index.js +52 -51
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -250,11 +250,13 @@ For `wb verify` and `wb verify --full`, a log-write failure falls back to printi
250
250
 
251
251
  `wb code-gauge` runs [`code-gauge check`](https://github.com/WillBooster/code-gauge#threshold-check-code-gauge-check)
252
252
  on the project and prints every threshold violation as an error or a warning: functions and files
253
- over a metric limit, and duplicated blocks. A path limits the check to that file or directory (a directory's
254
- test files are skipped, so a directory holding only test files is reported as unchecked, while a
255
- file named as the path is checked even when it is a test file), and
256
- `--base <ref>` to what the working tree changed since the merge-base with `<ref>`, in which case a
257
- path without a changed file to check prints nothing. The command
253
+ over a metric limit, duplicated blocks, and a share of test code over its limit (by default, test
254
+ NCSS over 30% of production NCSS under the checked directory). A path limits the check to that file or
255
+ directory. The metrics of functions, files, and duplicated blocks skip a directory's test files, so a
256
+ directory holding only test files is reported as unchecked (a file named as the path is checked even
257
+ when it is a test file); the share counts them. `--base <ref>` limits the check to what the working
258
+ tree changed since the merge-base with `<ref>`: functions, files, and blocks the change touches, and
259
+ the share when the change adds or edits a test, even a change touching only tests. The command
258
260
  always exits with 0, including when there are errors or the check cannot complete.
259
261
 
260
262
  ```sh
@@ -265,8 +267,10 @@ bun wb code-gauge --base origin/HEAD
265
267
 
266
268
  `wb verify` and `wb verify --full` run the same check as their `code-gauge` step and print the
267
269
  violations after the recap: the totals per level, how many are in code changed since the merge-base
268
- with `origin/HEAD`, and at most 10 violations: those in the changed code first, then the rest, each
269
- group with its errors before its warnings. A limit milder than its line's level names its own, as in
270
+ with `origin/HEAD`, and at most 10 violations and directive errors: those in the changed code first,
271
+ then the rest, each group with the share of test code first whatever its level, then its errors,
272
+ then its directive errors, then its warnings. A branch's share of test code asks a change that adds
273
+ test code to add none, and only reports one that does not; elsewhere it names the test NCSS to delete or merge. A limit milder than its line's level names its own, as in
270
274
  `error: ... function cognitive complexity 56 (max 30; largest parts L12-31 19, L33-40 isLegacy 8), function ncss 41 (warning max 30)`,
271
275
  where the largest parts are the lines adding the most to the cognitive complexity. After the
272
276
  violations come the instructions for handling them. The step never fails verification.