Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ clean bill of health nobody examined is worth less than nothing.
- uses: actions/checkout@v4
with:
fetch-depth: 0 # docproof needs history to tell drift from an example
- uses: melbinjp/docproof@v0.1.4
- uses: melbinjp/docproof@v0.2.0
```

**Both lines are load-bearing, and the action refuses to run without the first.**
Expand Down Expand Up @@ -345,7 +345,7 @@ A gate that fails on day one gets removed on day one. `--exit-zero` prints the f
leaves the run green, so you can adopt this while you are still working through them:

```yaml
- uses: melbinjp/docproof@v0.1.4
- uses: melbinjp/docproof@v0.2.0
with:
fail-on-findings: false
```
Expand Down Expand Up @@ -398,7 +398,7 @@ not a promise the project is making.
silence harmless:

```
docproof 0.1.4 - myproject, 6 document(s)
docproof 0.2.0 - myproject, 6 document(s)
41 documentation file(s) elsewhere in the tree were NOT read; the default scope is top-level files plus doc/ and docs/
guides/ 22, website/ 14, handbook/ 4, .github/ 1
read them too with --docs 'guides/**/*.md' or [tool.docproof] docs = ["guides/**/*.md"]
Expand Down Expand Up @@ -473,7 +473,7 @@ never existed, so `docproof` reports that and judges nothing rather than guessin
- uses: actions/checkout@v4
with:
fetch-depth: 0 # docproof needs history to tell drift from an example
- uses: melbinjp/docproof@v0.1.4
- uses: melbinjp/docproof@v0.2.0
```

**The action refuses to run without `fetch-depth: 0`, on purpose.** Measured on
Expand Down
2 changes: 1 addition & 1 deletion src/docproof/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""docproof — prove your documentation against your code."""

__version__ = "0.1.4"
__version__ = "0.2.0"
31 changes: 31 additions & 0 deletions tests/test_version_has_one_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,34 @@ def test_the_release_gate_reads_the_same_file_the_build_does() -> None:
"release.yml no longer resolves the version file through [tool.hatch.version]. "
"Hardcoding it lets the gate and the build drift onto different files."
)


def test_the_readme_sample_report_shows_the_current_version() -> None:
"""The README's ILLUSTRATIVE sample report carries a version, and it went stale.

It read `docproof 0.1.4` while the package moved on: the same drift the action pins
already have a gate for, in the same file, unguarded.

**Placeholder samples only, and the exclusion is the interesting half.** The README also
opens with a verbatim run against `pallets/click` whose header says `docproof 0.1.0`, and
that one must NOT be updated. The README says why, at length: the tool misreported its own
version until #9, the block is a real transcript, and *"editing the output would make it a
mock-up: the same move as editing a document instead of fixing the code."*

The first version of this test asserted every header matched and failed on exactly that
block - correctly, and with the wrong remedy. A check that would force a true record to be
falsified is worse than no check, so this reads only headers naming the placeholder
project. A transcript names a real repository; a sample names `myproject`.
"""
from docproof import __version__

readme = (ROOT / "README.md").read_text(encoding="utf-8")
samples = re.findall(r"^docproof (\d+\.\d+\.\d+) . myproject", readme, re.M)

assert samples, "the README shows no placeholder sample report header to check"
wrong = sorted({s for s in samples if s != __version__})
assert wrong == [], (
f"README sample report shows {wrong} but the package is {__version__}. "
"A tool whose argument is that documentation drifts does not get to print a "
"version it is not."
)
Loading