@zgeoff/chex 0.2.3 → 0.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgeoff/chex",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
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",
@@ -41,7 +41,7 @@
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/bun": "1.4.4",
44
- "@zgeoff/rig": "0.2.1",
44
+ "@zgeoff/rig": "0.2.2",
45
45
  "@zgeoff/std": "0.4.3",
46
46
  "@zgeoff/testing": "0.3.0",
47
47
  "tiny-invariant": "1.3.3",
@@ -5,7 +5,8 @@
5
5
  # Usage (from the repo root): check-readmes.sh
6
6
  # The five kinds:
7
7
  # 1. the root README.md;
8
- # 2. a README in a folder that holds a package.json, go.mod or Cargo.toml;
8
+ # 2. a README in a folder that holds a package.json, go.mod, Cargo.toml, build.gradle.kts,
9
+ # build.gradle, settings.gradle.kts or settings.gradle;
9
10
  # 3. docs/README.md;
10
11
  # 4. a design README: docs/design/<work>/README.md, or the README of a folder inside a design folder
11
12
  # whose own README is a design README, outside any spikes/ folder;
@@ -78,12 +79,16 @@ is_design() {
78
79
  [ -n "${listed[$parent]:-}" ] && is_design "$parent"
79
80
  }
80
81
 
82
+ manifests=(package.json go.mod Cargo.toml build.gradle.kts build.gradle settings.gradle.kts settings.gradle)
83
+
81
84
  is_known() {
82
- local readme=$1 dir
85
+ local readme=$1 dir manifest
83
86
  dir=$(dirname "$readme")
84
87
 
85
88
  [ "$readme" = README.md ] && return 0
86
- [ -f "$dir/package.json" ] || [ -f "$dir/go.mod" ] || [ -f "$dir/Cargo.toml" ] && return 0
89
+ for manifest in "${manifests[@]}"; do
90
+ [ -f "$dir/$manifest" ] && return 0
91
+ done
87
92
  [ "$readme" = docs/README.md ] && return 0
88
93
  is_design "$readme" && return 0
89
94
  is_spike "$readme" && return 0