docstate 0.2.3__tar.gz → 0.2.4__tar.gz
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.
- {docstate-0.2.3 → docstate-0.2.4}/CHANGELOG.md +6 -0
- {docstate-0.2.3/src/docstate.egg-info → docstate-0.2.4}/PKG-INFO +16 -6
- {docstate-0.2.3 → docstate-0.2.4}/README.md +15 -5
- {docstate-0.2.3 → docstate-0.2.4}/src/docstate/__init__.py +1 -1
- {docstate-0.2.3 → docstate-0.2.4}/src/docstate/config.py +15 -2
- {docstate-0.2.3 → docstate-0.2.4/src/docstate.egg-info}/PKG-INFO +16 -6
- {docstate-0.2.3 → docstate-0.2.4}/tests/test_config.py +29 -0
- {docstate-0.2.3 → docstate-0.2.4}/tests/test_frontmatter.py +15 -0
- {docstate-0.2.3 → docstate-0.2.4}/LICENSE +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/MANIFEST.in +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/examples/basic/README.md +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/examples/basic/docs/guide.md +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/examples/basic/docs/status.md +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/examples/basic/docstate.toml +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/examples/basic/facts/status.json +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/examples/basic/templates/status.md +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/examples/table/README.md +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/examples/table/docs/judgments.md +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/examples/table/docstate.toml +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/examples/table/facts/judgments.json +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/examples/table/templates/judgments.md +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/pyproject.toml +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/setup.cfg +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/src/docstate/__main__.py +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/src/docstate/check.py +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/src/docstate/cli.py +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/src/docstate/errors.py +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/src/docstate/facts.py +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/src/docstate/frontmatter.py +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/src/docstate/render.py +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/src/docstate/scan.py +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/src/docstate/template.py +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/src/docstate.egg-info/SOURCES.txt +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/src/docstate.egg-info/dependency_links.txt +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/src/docstate.egg-info/entry_points.txt +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/src/docstate.egg-info/requires.txt +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/src/docstate.egg-info/top_level.txt +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/templates/docstate.schema.json +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/templates/docstate.toml +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/templates/pre-commit.yaml +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/templates/status.md +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/templates/vale.ini +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/tests/conftest.py +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/tests/fixtures/bad-json/docs/status.md +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/tests/fixtures/bad-json/docstate.toml +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/tests/fixtures/bad-json/facts/status.json +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/tests/fixtures/bad-json/templates/status.md +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/tests/fixtures/bad-markers/docs/other.md +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/tests/fixtures/bad-markers/docs/status.md +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/tests/fixtures/bad-markers/docstate.toml +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/tests/fixtures/bad-markers/facts/status.json +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/tests/fixtures/bad-markers/templates/status.md +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/tests/fixtures/basic/README.md +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/tests/fixtures/basic/docs/guide.md +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/tests/fixtures/basic/docs/status.md +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/tests/fixtures/basic/docstate.toml +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/tests/fixtures/basic/facts/status.json +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/tests/fixtures/basic/templates/status.md +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/tests/fixtures/frontmatter/CHANGELOG.md +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/tests/fixtures/frontmatter/docs/README.md +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/tests/fixtures/frontmatter/docs/bad.md +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/tests/fixtures/frontmatter/docs/design.md +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/tests/fixtures/frontmatter/docstate.toml +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/tests/fixtures/frontmatter/facts/status.json +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/tests/fixtures/frontmatter/templates/summary.md +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/tests/fixtures/table/docs/status.md +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/tests/fixtures/table/docstate.toml +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/tests/fixtures/table/facts/judgments.json +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/tests/fixtures/table/templates/judgments.md +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/tests/test_anchors.py +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/tests/test_check.py +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/tests/test_cli.py +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/tests/test_examples.py +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/tests/test_render.py +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/tests/test_scan.py +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/tests/test_template.py +0 -0
- {docstate-0.2.3 → docstate-0.2.4}/tests/test_template_v2.py +0 -0
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.4 - 2026-12-06
|
|
4
|
+
|
|
5
|
+
- Add `exclude` to `[check.frontmatter]`. Matched files are removed before any frontmatter check, the same way `[[check.forbidden]].exclude` works.
|
|
6
|
+
- The vault uses it for the second parallel cell: `check-doc-status.mjs` and the docstate frontmatter rule must report the same missing-status, illegal-status, and BOM document sets.
|
|
7
|
+
|
|
3
8
|
## 0.2.3 - 2026-12-06
|
|
4
9
|
|
|
5
10
|
- Add `docstate check --json`: files, blocks, error/warning counts, and every finding with severity/kind/path/line/field/message.
|
|
6
11
|
- `--strict` still exits 1 only when an error-severity finding exists; warnings remain report-only.
|
|
12
|
+
- Published 0.2.3 to PyPI; `pipx install docstate` now works.
|
|
7
13
|
|
|
8
14
|
## 0.2.2 - 2026-12-06
|
|
9
15
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: docstate
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.4
|
|
4
4
|
Summary: Generate Markdown blocks from JSON facts and fail when the document drifts
|
|
5
5
|
Author: The docstate authors
|
|
6
6
|
License-Expression: MIT
|
|
@@ -32,6 +32,7 @@ Dynamic: license-file
|
|
|
32
32
|
Generate Markdown blocks from JSON facts, and fail when the document drifts from them.
|
|
33
33
|
|
|
34
34
|
[](https://github.com/XinBuilds/docstate/actions/workflows/test.yml)
|
|
35
|
+
[](https://pypi.org/project/docstate/)
|
|
35
36
|
|
|
36
37
|
`docstate` rewrites the content between two HTML comment markers in your Markdown with values rendered from a JSON file. A second command compares the two and exits non-zero on drift, so stale facts fail CI instead of quietly misleading readers.
|
|
37
38
|
|
|
@@ -46,16 +47,23 @@ Generate Markdown blocks from JSON facts, and fail when the document drifts from
|
|
|
46
47
|
|
|
47
48
|
## Install
|
|
48
49
|
|
|
49
|
-
|
|
50
|
+
Install from PyPI:
|
|
50
51
|
|
|
51
52
|
```sh
|
|
52
|
-
pipx install
|
|
53
|
+
pipx install docstate
|
|
53
54
|
```
|
|
54
55
|
|
|
55
|
-
|
|
56
|
+
Pin a version:
|
|
56
57
|
|
|
57
58
|
```sh
|
|
58
|
-
|
|
59
|
+
pipx install docstate==0.2.4
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Or install from the GitHub tag / release:
|
|
63
|
+
|
|
64
|
+
```sh
|
|
65
|
+
pipx install "git+https://github.com/XinBuilds/docstate.git@v0.2.4"
|
|
66
|
+
pip install https://github.com/XinBuilds/docstate/releases/download/v0.2.4/docstate-0.2.4-py3-none-any.whl
|
|
59
67
|
```
|
|
60
68
|
|
|
61
69
|
Or install from a checkout:
|
|
@@ -115,7 +123,7 @@ content here is replaced by render
|
|
|
115
123
|
To make drift fail in CI, add two steps:
|
|
116
124
|
|
|
117
125
|
```yaml
|
|
118
|
-
- run: pipx install
|
|
126
|
+
- run: pipx install docstate==0.2.4
|
|
119
127
|
- run: docstate check --config docstate.toml --strict
|
|
120
128
|
```
|
|
121
129
|
|
|
@@ -216,6 +224,7 @@ Findings are printed as `path:line: error[kind:field]: message` or `warning[...]
|
|
|
216
224
|
```toml
|
|
217
225
|
[check.frontmatter]
|
|
218
226
|
files = ["docs/**/*.md"]
|
|
227
|
+
exclude = ["docs/research/**", "docs/README.md"]
|
|
219
228
|
require = ["status", "last_reviewed"]
|
|
220
229
|
status_field = "status"
|
|
221
230
|
status_values = ["draft", "review", "decided", "implemented", "superseded", "archived"]
|
|
@@ -236,6 +245,7 @@ changelog = "docs/CHANGELOG.md"
|
|
|
236
245
|
|
|
237
246
|
Rules:
|
|
238
247
|
|
|
248
|
+
- `exclude` removes matched files before any frontmatter check runs. Use it for directories or files that are not required to carry the metadata.
|
|
239
249
|
- `require` fields must exist and be non-empty. `status_values`, when set, rejects other values.
|
|
240
250
|
- `bom` reports a UTF-8 BOM; `warn` is the default, `ignore` disables it.
|
|
241
251
|
- An owner declares the authoritative value of a field (for example `project_stage`). Other matched documents may omit the field, but if they set it, the value must match the owner.
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Generate Markdown blocks from JSON facts, and fail when the document drifts from them.
|
|
4
4
|
|
|
5
5
|
[](https://github.com/XinBuilds/docstate/actions/workflows/test.yml)
|
|
6
|
+
[](https://pypi.org/project/docstate/)
|
|
6
7
|
|
|
7
8
|
`docstate` rewrites the content between two HTML comment markers in your Markdown with values rendered from a JSON file. A second command compares the two and exits non-zero on drift, so stale facts fail CI instead of quietly misleading readers.
|
|
8
9
|
|
|
@@ -17,16 +18,23 @@ Generate Markdown blocks from JSON facts, and fail when the document drifts from
|
|
|
17
18
|
|
|
18
19
|
## Install
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
Install from PyPI:
|
|
21
22
|
|
|
22
23
|
```sh
|
|
23
|
-
pipx install
|
|
24
|
+
pipx install docstate
|
|
24
25
|
```
|
|
25
26
|
|
|
26
|
-
|
|
27
|
+
Pin a version:
|
|
27
28
|
|
|
28
29
|
```sh
|
|
29
|
-
|
|
30
|
+
pipx install docstate==0.2.4
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Or install from the GitHub tag / release:
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
pipx install "git+https://github.com/XinBuilds/docstate.git@v0.2.4"
|
|
37
|
+
pip install https://github.com/XinBuilds/docstate/releases/download/v0.2.4/docstate-0.2.4-py3-none-any.whl
|
|
30
38
|
```
|
|
31
39
|
|
|
32
40
|
Or install from a checkout:
|
|
@@ -86,7 +94,7 @@ content here is replaced by render
|
|
|
86
94
|
To make drift fail in CI, add two steps:
|
|
87
95
|
|
|
88
96
|
```yaml
|
|
89
|
-
- run: pipx install
|
|
97
|
+
- run: pipx install docstate==0.2.4
|
|
90
98
|
- run: docstate check --config docstate.toml --strict
|
|
91
99
|
```
|
|
92
100
|
|
|
@@ -187,6 +195,7 @@ Findings are printed as `path:line: error[kind:field]: message` or `warning[...]
|
|
|
187
195
|
```toml
|
|
188
196
|
[check.frontmatter]
|
|
189
197
|
files = ["docs/**/*.md"]
|
|
198
|
+
exclude = ["docs/research/**", "docs/README.md"]
|
|
190
199
|
require = ["status", "last_reviewed"]
|
|
191
200
|
status_field = "status"
|
|
192
201
|
status_values = ["draft", "review", "decided", "implemented", "superseded", "archived"]
|
|
@@ -207,6 +216,7 @@ changelog = "docs/CHANGELOG.md"
|
|
|
207
216
|
|
|
208
217
|
Rules:
|
|
209
218
|
|
|
219
|
+
- `exclude` removes matched files before any frontmatter check runs. Use it for directories or files that are not required to carry the metadata.
|
|
210
220
|
- `require` fields must exist and be non-empty. `status_values`, when set, rejects other values.
|
|
211
221
|
- `bom` reports a UTF-8 BOM; `warn` is the default, `ignore` disables it.
|
|
212
222
|
- An owner declares the authoritative value of a field (for example `project_stage`). Other matched documents may omit the field, but if they set it, the value must match the owner.
|
|
@@ -233,7 +233,17 @@ def _parse_frontmatter_rule(base: Path, raw: object) -> FrontmatterRule:
|
|
|
233
233
|
fail("CFG_SCHEMA", "check.frontmatter must be a table")
|
|
234
234
|
_reject_unknown(
|
|
235
235
|
raw,
|
|
236
|
-
{
|
|
236
|
+
{
|
|
237
|
+
"files",
|
|
238
|
+
"exclude",
|
|
239
|
+
"require",
|
|
240
|
+
"status_field",
|
|
241
|
+
"status_values",
|
|
242
|
+
"bom",
|
|
243
|
+
"status_review",
|
|
244
|
+
"updated_field",
|
|
245
|
+
"owners",
|
|
246
|
+
},
|
|
237
247
|
"check.frontmatter",
|
|
238
248
|
)
|
|
239
249
|
files_raw = raw.get("files")
|
|
@@ -242,7 +252,10 @@ def _parse_frontmatter_rule(base: Path, raw: object) -> FrontmatterRule:
|
|
|
242
252
|
patterns = _list_of_strings(files_raw, "check.frontmatter.files")
|
|
243
253
|
if not patterns:
|
|
244
254
|
fail("CFG_SCHEMA", "check.frontmatter.files must not be empty")
|
|
245
|
-
|
|
255
|
+
exclude = _list_of_strings(raw.get("exclude"), "check.frontmatter.exclude")
|
|
256
|
+
for value in exclude:
|
|
257
|
+
_check_pattern(value, "check.frontmatter.exclude")
|
|
258
|
+
files = _expand_check_files(base, patterns, [], exclude)
|
|
246
259
|
|
|
247
260
|
status_field = _validate_field(raw.get("status_field", "status"), "check.frontmatter.status_field")
|
|
248
261
|
updated_field = _validate_field(raw.get("updated_field", "updated"), "check.frontmatter.updated_field")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: docstate
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.4
|
|
4
4
|
Summary: Generate Markdown blocks from JSON facts and fail when the document drifts
|
|
5
5
|
Author: The docstate authors
|
|
6
6
|
License-Expression: MIT
|
|
@@ -32,6 +32,7 @@ Dynamic: license-file
|
|
|
32
32
|
Generate Markdown blocks from JSON facts, and fail when the document drifts from them.
|
|
33
33
|
|
|
34
34
|
[](https://github.com/XinBuilds/docstate/actions/workflows/test.yml)
|
|
35
|
+
[](https://pypi.org/project/docstate/)
|
|
35
36
|
|
|
36
37
|
`docstate` rewrites the content between two HTML comment markers in your Markdown with values rendered from a JSON file. A second command compares the two and exits non-zero on drift, so stale facts fail CI instead of quietly misleading readers.
|
|
37
38
|
|
|
@@ -46,16 +47,23 @@ Generate Markdown blocks from JSON facts, and fail when the document drifts from
|
|
|
46
47
|
|
|
47
48
|
## Install
|
|
48
49
|
|
|
49
|
-
|
|
50
|
+
Install from PyPI:
|
|
50
51
|
|
|
51
52
|
```sh
|
|
52
|
-
pipx install
|
|
53
|
+
pipx install docstate
|
|
53
54
|
```
|
|
54
55
|
|
|
55
|
-
|
|
56
|
+
Pin a version:
|
|
56
57
|
|
|
57
58
|
```sh
|
|
58
|
-
|
|
59
|
+
pipx install docstate==0.2.4
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Or install from the GitHub tag / release:
|
|
63
|
+
|
|
64
|
+
```sh
|
|
65
|
+
pipx install "git+https://github.com/XinBuilds/docstate.git@v0.2.4"
|
|
66
|
+
pip install https://github.com/XinBuilds/docstate/releases/download/v0.2.4/docstate-0.2.4-py3-none-any.whl
|
|
59
67
|
```
|
|
60
68
|
|
|
61
69
|
Or install from a checkout:
|
|
@@ -115,7 +123,7 @@ content here is replaced by render
|
|
|
115
123
|
To make drift fail in CI, add two steps:
|
|
116
124
|
|
|
117
125
|
```yaml
|
|
118
|
-
- run: pipx install
|
|
126
|
+
- run: pipx install docstate==0.2.4
|
|
119
127
|
- run: docstate check --config docstate.toml --strict
|
|
120
128
|
```
|
|
121
129
|
|
|
@@ -216,6 +224,7 @@ Findings are printed as `path:line: error[kind:field]: message` or `warning[...]
|
|
|
216
224
|
```toml
|
|
217
225
|
[check.frontmatter]
|
|
218
226
|
files = ["docs/**/*.md"]
|
|
227
|
+
exclude = ["docs/research/**", "docs/README.md"]
|
|
219
228
|
require = ["status", "last_reviewed"]
|
|
220
229
|
status_field = "status"
|
|
221
230
|
status_values = ["draft", "review", "decided", "implemented", "superseded", "archived"]
|
|
@@ -236,6 +245,7 @@ changelog = "docs/CHANGELOG.md"
|
|
|
236
245
|
|
|
237
246
|
Rules:
|
|
238
247
|
|
|
248
|
+
- `exclude` removes matched files before any frontmatter check runs. Use it for directories or files that are not required to carry the metadata.
|
|
239
249
|
- `require` fields must exist and be non-empty. `status_values`, when set, rejects other values.
|
|
240
250
|
- `bom` reports a UTF-8 BOM; `warn` is the default, `ignore` disables it.
|
|
241
251
|
- An owner declares the authoritative value of a field (for example `project_stage`). Other matched documents may omit the field, but if they set it, the value must match the owner.
|
|
@@ -86,3 +86,32 @@ def test_rejects_symlinked_fact(copy_fixture, tmp_path):
|
|
|
86
86
|
load_config(root / "docstate.toml")
|
|
87
87
|
assert error.value.code == "CFG_PATH"
|
|
88
88
|
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def test_frontmatter_exclude_filters_matched_files(tmp_path):
|
|
92
|
+
(tmp_path / "docs").mkdir()
|
|
93
|
+
(tmp_path / "docs" / "keep.md").write_text("---\nstatus: draft\n---\n", encoding="utf-8")
|
|
94
|
+
(tmp_path / "docs" / "skip.md").write_text("# no status\n", encoding="utf-8")
|
|
95
|
+
(tmp_path / "README.md").write_text("# readme\n", encoding="utf-8")
|
|
96
|
+
config_path = tmp_path / "docstate.toml"
|
|
97
|
+
config_path.write_text(
|
|
98
|
+
'version = 1\ndialect = "scalar-v1"\n\n[check.frontmatter]\n'
|
|
99
|
+
'files = ["**/*.md"]\nexclude = ["docs/skip.md", "README.md"]\nrequire = ["status"]\n',
|
|
100
|
+
encoding="utf-8",
|
|
101
|
+
)
|
|
102
|
+
config = load_config(config_path)
|
|
103
|
+
assert config.frontmatter is not None
|
|
104
|
+
assert [p.relative_to(tmp_path).as_posix() for p in config.frontmatter.files] == ["docs/keep.md"]
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
def test_frontmatter_exclude_rejects_parent_paths(tmp_path):
|
|
108
|
+
(tmp_path / "doc.md").write_text("---\nstatus: draft\n---\n", encoding="utf-8")
|
|
109
|
+
config_path = tmp_path / "docstate.toml"
|
|
110
|
+
config_path.write_text(
|
|
111
|
+
'version = 1\ndialect = "scalar-v1"\n\n[check.frontmatter]\n'
|
|
112
|
+
'files = ["*.md"]\nexclude = ["../outside.md"]\nrequire = ["status"]\n',
|
|
113
|
+
encoding="utf-8",
|
|
114
|
+
)
|
|
115
|
+
with pytest.raises(DocstateError) as error:
|
|
116
|
+
load_config(config_path)
|
|
117
|
+
assert error.value.code == "CFG_PATH"
|
|
@@ -183,3 +183,18 @@ def test_strict_fails_on_error_but_not_warning(tmp_path, capsys):
|
|
|
183
183
|
write(doc, "---\nstatus: review\nupdated: 2026-12-01\n---\n\n<!-- BEGIN GENERATED: summary -->\nok\n<!-- END GENERATED: summary -->\n\ntwo\n")
|
|
184
184
|
assert main(["check", "--config", str(tmp_path / "docstate.toml"), "--strict"]) == 1
|
|
185
185
|
assert "error[status:updated]" in capsys.readouterr().out
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
def test_excluded_file_produces_no_findings(tmp_path):
|
|
189
|
+
(tmp_path / "docs").mkdir()
|
|
190
|
+
write(tmp_path / "docs" / "keep.md", "---\nstatus: draft\n---\n# keep\n")
|
|
191
|
+
write(tmp_path / "docs" / "skip.md", "# no frontmatter\n")
|
|
192
|
+
config_path = tmp_path / "docstate.toml"
|
|
193
|
+
config_path.write_text(
|
|
194
|
+
'version = 1\ndialect = "scalar-v1"\n\n[check.frontmatter]\n'
|
|
195
|
+
'files = ["docs/**/*.md"]\nexclude = ["docs/skip.md"]\nrequire = ["status"]\n'
|
|
196
|
+
'status_values = ["draft", "review"]\n',
|
|
197
|
+
encoding="utf-8",
|
|
198
|
+
)
|
|
199
|
+
config = load_config(config_path)
|
|
200
|
+
assert _frontmatter_findings(config.frontmatter, tmp_path) == []
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|