@zgeoff/chex 0.4.5 → 0.4.7

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/lefthook.yml CHANGED
@@ -45,16 +45,22 @@ pre-push:
45
45
  run: '{clear-git-env} bun x --no-install diet -- bun x --no-install chex uncommitted'
46
46
  - name: chex-format:check
47
47
  run: '{clear-git-env} bun x --no-install diet -- bun run format:check'
48
- # Plain oxlint, without the unused-directive check: a directive for a
49
- # type-aware rule reads as unused in plain mode.
48
+ # Type-aware oxlint on the files the branch changes only. Two threads keep
49
+ # its peak near 730 MB, which fits beside an agent in a 1.4 GB imp; the
50
+ # whole repo peaks near 1.2 GB, so CI runs lint:full on the whole tree.
50
51
  - name: chex-lint
51
52
  files:
52
53
  unset $(git rev-parse --local-env-vars); bun
53
54
  node_modules/@zgeoff/chex/src/branch/read-branch-files.ts
54
55
  glob: '*.{js,mjs,cjs,jsx,ts,mts,cts,tsx}'
55
56
  run:
56
- '{clear-git-env} bun x --no-install diet -- bun x --no-install oxlint
57
- --no-error-on-unmatched-pattern {files}'
57
+ '{clear-git-env} bun x --no-install diet -- bun x --no-install oxlint --type-aware
58
+ --type-check --threads=2 --no-error-on-unmatched-pattern {files}'
59
+ # A repo without the script passes: bun run --if-present exits 0.
60
+ - name: chex-deadcode
61
+ run: '{clear-git-env} bun x --no-install diet -- bun run --if-present deadcode'
62
+ - name: chex-verify-lint
63
+ run: '{clear-git-env} bun x --no-install diet -- bun run --if-present verify lint'
58
64
  # Each file check reads only the files the branch changes that match its
59
65
  # glob, so a file the branch leaves unchanged never fails a push. A check
60
66
  # whose program the machine lacks prints a notice and passes: CI installs
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgeoff/chex",
3
- "version": "0.4.5",
3
+ "version": "0.4.7",
4
4
  "description": "Run each shared docs and repo check as one subcommand, with the lefthook pre-push baseline that calls them",
5
5
  "keywords": [
6
6
  "checks",
@@ -146,7 +146,7 @@ const labelOrder: readonly string[] = ['Needs the owner', 'Later'];
146
146
  const labelLine = /^\*\*(?<label>[^*]+)\*\*:?\s*$/u;
147
147
  const bulletLine = /^[-*+]\s+/u;
148
148
  const checkboxBullet = /^[-*+]\s+\[[ xX]\]\s+\S/u;
149
- const issueEnding = /\((?:[A-Z][A-Z0-9]*-\d+|#\d+|[\w.-]+\/[\w.-]+#\d+)\)\.?$/u;
149
+ const issueEnding = /\((?:[A-Z][A-Z0-9]*-\d+|i-[1-9]\d*|#\d+|[\w.-]+\/[\w.-]+#\d+)\)\.?$/u;
150
150
 
151
151
  function collectNextStepsErrors(section: BodySection): string[] {
152
152
  const errors: string[] = [];
@@ -204,7 +204,7 @@ function collectNextStepsErrors(section: BodySection): string[] {
204
204
 
205
205
  if (group.label === 'Later' && !issueEnding.test(item.trim())) {
206
206
  errors.push(
207
- `Next steps: "${item.trim()}" under **Later** does not end with an issue ID in brackets such as (GEO-124) or (#45); file the issue and add it.`,
207
+ `Next steps: "${item.trim()}" under **Later** does not end with an issue ID in brackets such as (GEO-124), (#45) or (i-124); file the issue and add it.`,
208
208
  );
209
209
  }
210
210
  }
@@ -269,7 +269,9 @@ function collectShaErrors(name: string, sha: string, facts: BranchFacts): string
269
269
  ];
270
270
  }
271
271
 
272
- if (state === 'old' && facts.newestDocChange !== undefined) {
272
+ // A cold read runs on a budget and never comes back empty, so a later doc commit leaves its sha
273
+ // standing; deslop runs on every doc commit, so its sha must be current.
274
+ if (state === 'old' && name === 'Deslop' && facts.newestDocChange !== undefined) {
273
275
  return [
274
276
  `Checks: ${name} (${sha}) is older than commit ${facts.newestDocChange.commit.slice(0, 7)}, which changes ${facts.newestDocChange.files.join(', ')}; re-run that check and update the sha.`,
275
277
  ];