Repository navigation
fix(docs): a new doc counts only if it adds a line the deleted docs lack (#1365) - #1402
Merged
Merged
Conversation
…cs the PR deletes (#1365)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1365
Summary
scripts/check-docs.jscompared a doc with no previous version (git D + A, not a rename) against the whole visible body of each doc deleted in the PR, so splitting one owner doc into two, or merging two into one, passed the docs gate without any new prose. A doc with no previous version now qualifies only if at least one nonempty normalized body line (front matter stripped,visiblenormalisation: whitespace, Unicode control and format characters removed) appears in none of the docs the PR deletes. Docs with a previous version (including renames) keep the whole-body comparison. Limit, documented: rewrapping existing words across lines can produce a qualifying line.Tests
test/check-docs.test.js: split A+B → A, B fails; merge A, B → A+B fails; a moved doc with one new line passes; a new doc with no deleted docs still qualifies; renames unchanged; blank-only, whitespace-only, control/format-only, metadata-only and lines taken from a deleted non-owner doc do not qualify. RED before the change: 7 assertion failures (not ok 119 - … split A+B into A and B …,true !== false). Four mutations caught. 147/147 pass.Docs
.ai/contexts/fast-check.mddescribes the rule and its limit.