Commit 1feb996
committed
feat(check): add
Enumerates every candidate path the doc scanner considered, tagging
each `loaded` / `skipped (<reason>)` / `excluded (<glob>)`. Mirrors the
existing oracle pattern (`rivet check sources` / `bidirectional` /
`gaps_json`) — narrow, mechanical, scriptable. Default output is human
text; `--format json` emits the canonical `{oracle,entries,total,
by_status}` envelope for pipeline consumers. `--strict` exits non-zero
when any entry is `skipped` (explicit `excluded` allowlist matches do
not trip strict).
Reuses the existing `load_documents_with_report` iteration verbatim
via a new `scan_documents(dir, exclude) -> Vec<ScannedDoc>` that
returns per-path detail instead of emitting stderr warnings — the
warning-printing path is left untouched, so `rivet validate`'s output
is byte-identical.
Tests: `rivet-cli/tests/docs_check.rs` covers the four fixture cases
(loaded / no-frontmatter / missing-id frontmatter / excluded-by-glob),
the strict exit-code branches in both directions, and the human-text
shape.
Closes #540.
Implements: REQ-007
Refs: REQ-004rivet check docs oracle with --format json + --strict (#540)1 parent b376195 commit 1feb996
5 files changed
Lines changed: 628 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1871 | 1871 | | |
1872 | 1872 | | |
1873 | 1873 | | |
| 1874 | + | |
| 1875 | + | |
| 1876 | + | |
| 1877 | + | |
| 1878 | + | |
| 1879 | + | |
| 1880 | + | |
| 1881 | + | |
| 1882 | + | |
| 1883 | + | |
| 1884 | + | |
| 1885 | + | |
| 1886 | + | |
| 1887 | + | |
| 1888 | + | |
| 1889 | + | |
| 1890 | + | |
| 1891 | + | |
| 1892 | + | |
| 1893 | + | |
1874 | 1894 | | |
1875 | 1895 | | |
1876 | 1896 | | |
| |||
2392 | 2412 | | |
2393 | 2413 | | |
2394 | 2414 | | |
| 2415 | + | |
2395 | 2416 | | |
2396 | 2417 | | |
2397 | 2418 | | |
| |||
13603 | 13624 | | |
13604 | 13625 | | |
13605 | 13626 | | |
| 13627 | + | |
| 13628 | + | |
| 13629 | + | |
| 13630 | + | |
| 13631 | + | |
| 13632 | + | |
| 13633 | + | |
| 13634 | + | |
| 13635 | + | |
| 13636 | + | |
| 13637 | + | |
| 13638 | + | |
| 13639 | + | |
| 13640 | + | |
| 13641 | + | |
| 13642 | + | |
| 13643 | + | |
| 13644 | + | |
| 13645 | + | |
| 13646 | + | |
| 13647 | + | |
| 13648 | + | |
| 13649 | + | |
| 13650 | + | |
| 13651 | + | |
| 13652 | + | |
| 13653 | + | |
| 13654 | + | |
| 13655 | + | |
| 13656 | + | |
| 13657 | + | |
| 13658 | + | |
| 13659 | + | |
| 13660 | + | |
| 13661 | + | |
| 13662 | + | |
13606 | 13663 | | |
13607 | 13664 | | |
13608 | 13665 | | |
| |||
0 commit comments