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
12 changes: 11 additions & 1 deletion src/docproof/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,17 @@
# it is a statement about a past release, exactly like a changelog entry, and the only
# reason it was not already caught is that "upgrading" was never on this list.
_HISTORICAL_NAMES = (
r"changelog | changes | history | news | releases? | release[-_ ]?notes"
# `changelogs?` and not `changelog`, which is the same class of miss as the version
# suffix below: the rule already knows the word and could not see an ordinary spelling of
# it. `cozystack/cozystack` was reported for `docs/changelogs/v1.3.4.md` naming a
# controller deleted five months later, which is a changelog being a changelog.
#
# Measured over every clone on disk before taking it, because one finding is not evidence
# and the convention is: **four repositories keep a `changelogs/` directory** - coolify,
# cozystack, ruff and uv - and twelve keep one of `changelogs/`, `release-notes/`,
# `releasenotes/` or `.changeset/changelogs/`. The hyphenated and unseparated forms
# already matched; only the plural did not.
r"changelogs? | changes | history | news | releases? | release[-_ ]?notes"
r" | whatsnew | what[-_]s[-_]new | upgrad(?:e|ing) | migrat(?:e|ion|ing)"
)
# Matches the file's own name *and* any directory on the way to it. Pillow keeps its
Expand Down
36 changes: 36 additions & 0 deletions tests/test_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -883,3 +883,39 @@ def test_release_notes_are_history_even_with_the_version_in_the_name():
"README.md",
):
assert not is_historical(path), path


def test_a_changelogs_directory_is_history_too():
"""`changelog` has been on `_HISTORICAL_NAMES` since the fastapi measurement and could not
see the plural. `cozystack/cozystack` was reported for `docs/changelogs/v1.3.4.md` naming
`internal/controller/dashboard/customformsoverride.go`, deleted five months after that
release, which is a changelog being a changelog.

Measured over every clone on disk rather than taken on the one finding: **four keep a
`changelogs/` directory** - coolify, cozystack, ruff, uv - and twelve keep one of
`changelogs/`, `release-notes/`, `releasenotes/` or `.changeset/changelogs/`. Only the
plural was missing; the hyphenated and unseparated forms already matched.
"""
from docproof.config import is_historical

for path in (
"docs/changelogs/v1.3.4.md",
"changelogs/2026.md",
".changeset/changelogs/x.md",
"docs/release-notes/8.0.md",
"docs/releasenotes/2.3.2.rst",
):
assert is_historical(path), path

for path in (
"docs/changelog-policy.md",
"docs/changelogging.md",
"docs/how-we-write-changelogs.md",
"README.md",
):
assert not is_historical(path), path

# `src/changelogs.py` DOES match, and is left matching. The rule only ever sees
# documentation - `find_docs` yields `.md`, `.rst` and `.txt` - so a Python module named
# for changelogs never reaches this function, and the pre-existing singular had the same
# property. Asserting on an input the function cannot receive would test the test.
Loading