Problem
changed_lines in .github/actions/prose-gate/prose_lint.py keys diff scope off a +++ header it expects to begin b/. That prefix is not a property of git's output, it is a default the host's configuration can change, and the gate reads whichever the host has rather than pinning its own.
Four ordinary settings each empty the scope:
| Setting |
What the header becomes |
diff.noprefix=true |
+++ file.md, no prefix at all |
diff.mnemonicPrefix=true |
+++ w/file.md, the prefix varying by source |
diff.dstPrefix=y/ |
+++ y/file.md |
diff.external=<command> |
no diff body at all |
An empty scope is falsy, so the if scope and not matched refusal in main never fires. The run prints scope: 0 of N file(s) read and exits 0.
Evidence
Constructed: a repository holding one file with a duplicated word, one changed line.
settings unset exit 1, the violation reported
diff.mnemonicPrefix scope: 0 of 1 file(s) read, exit 0
diff.noprefix scope: 0 of 1 file(s) read, exit 0
diff.dstPrefix=y/ scope: 0 of 1 file(s) read, exit 0
diff.external=<cmd> scope: 0 of 1 file(s) read, exit 0
Confirmed present at a3cd9c7, so this is not a regression from #1574.
Reach
diff.mnemonicPrefix is an ordinary developer setting, so a maintainer carrying it gets a clean verdict from every local pre-push run of the gate. A CI runner carries none of them, so CI is unaffected and nothing here would notice.
Suggested fix
Pin what the parse depends on rather than inheriting it, the way #1574 pinned core.quotePath for the same reason in the same function: --no-ext-diff --src-prefix=a/ --dst-prefix=b/ on the same invocation. Verified to restore +++ b/ under all four settings.
TestDiffScopeReachesAQuotedName pins core.quotePath in its fixture and should pin these alongside it, since its own stated rationale covers them.
Found by a local review pass while fixing #1538 in #1574.
Problem
changed_linesin.github/actions/prose-gate/prose_lint.pykeys diff scope off a+++header it expects to beginb/. That prefix is not a property of git's output, it is a default the host's configuration can change, and the gate reads whichever the host has rather than pinning its own.Four ordinary settings each empty the scope:
diff.noprefix=true+++ file.md, no prefix at alldiff.mnemonicPrefix=true+++ w/file.md, the prefix varying by sourcediff.dstPrefix=y/+++ y/file.mddiff.external=<command>An empty scope is falsy, so the
if scope and not matchedrefusal inmainnever fires. The run printsscope: 0 of N file(s) readand exits 0.Evidence
Constructed: a repository holding one file with a duplicated word, one changed line.
Confirmed present at
a3cd9c7, so this is not a regression from #1574.Reach
diff.mnemonicPrefixis an ordinary developer setting, so a maintainer carrying it gets a clean verdict from every local pre-push run of the gate. A CI runner carries none of them, so CI is unaffected and nothing here would notice.Suggested fix
Pin what the parse depends on rather than inheriting it, the way #1574 pinned
core.quotePathfor the same reason in the same function:--no-ext-diff --src-prefix=a/ --dst-prefix=b/on the same invocation. Verified to restore+++ b/under all four settings.TestDiffScopeReachesAQuotedNamepinscore.quotePathin its fixture and should pin these alongside it, since its own stated rationale covers them.Found by a local review pass while fixing #1538 in #1574.