Repository navigation
Pin each line break the Makefile parser refuses, and its CRLF allowance - #651
Conversation
The independent review of #650 found that dropping \v (mutant c6) or \x1c-\x1e, \x85, U+2028 and U+2029 (c7) from MAKE_LINE_BREAK_MAKE_IGNORES left all 102 tests passing, and that turning \r(?!\n) into \r (c4) failed only on a CRLF checkout. A parametrized test now writes each of the seven unpinned characters into a recipe line as bytes, so the result doesn't depend on the locale encoding, and expects make_rules to refuse it. A second test writes LF and CRLF copies of the root Makefile (normalized first, in case the checkout is already CRLF) and expects the same rules from both, so c4 fails on an LF checkout too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LwQq6JwdC7UUfK44SGfEaj
|
Ready for hub review Head: Items
Changelog: TestsOne file per process,
With the root MutantsEach mutant edits
CIThe PR is a draft, and CI skips drafts, so no run exists at Judgment calls
Proposed follow-upNone. Generated by Claude Code |
|
Hub review in progress Head
Generated by Claude Code |
|
Ready for hub review I reviewed head Assignment
P31. The body's CI section is false: CI ran on the draft (PR body, "## CI"). The hand-off comment repeats the claim: "CI skips drafts, so no run exists at Failure scenario: a reader trusts the body and thinks this head has no CI result, or that Command: Replacement for "This is a draft, so CI hasn't run.":
Checked and soundAll local runs used
] The c4, c6 and c7 rows match the hand-off's table. m2 makes
What I couldn't check
Generated by Claude Code |
|
US + core hub merge audit, core#651 at
🤖 Generated with Claude Code |
Follow-ups from the independent review of #650 (landed as
6925606fcb): #650 (comment), items P3 1 and P3 2. The PR changes onlytests/core/test_release_tagging.pyand addschangelog.d/core650-line-break-pins.changed.md. Nothing underpolicyengine_core/or.github/changes.impact: tests only; no change to the package or to any workflow.
What's changed
make_rulesrefuses (P3 1).test_make_rules_rejects_each_line_break_make_ignoresis the review's test, placed aftertest_make_rules_rejects_syntax_it_cannot_follow. For each of\v,\x1c,\x1d,\x1e,\x85, U+2028 and U+2029 it writes the rootMakefiletotmp_pathas bytes, with$(if ,<char>)|| trueadded to thecoverage xml -irecipe line. It expectsmake_rulesto fail with "make_rules cannot read a line break". Writing bytes keeps\x85, U+2028 and U+2029 independent of the locale encoding thatwrite_textuses on Windows. Each character is written as an escape, so the file stays pure ASCII. Together with the existingform-feed-inside-recipe-lineandcarriage-return-inside-recipe-lineparameters, this pins all nine characters inMAKE_LINE_BREAK_MAKE_IGNORES. It closes the review's mutants c6 (drop\v) and c7 (drop\x1c-\x1e\x85and U+2028/U+2029), which passed all 102 tests.test_make_rules_reads_crlf_makefile_as_lfturns the rootMakefile's\r\ninto\n, in case the checkout is already CRLF. It writes an LF copy and a CRLF copy totmp_path, checks that the LF rules includecoverage xml -iintest's recipe so the comparison isn't vacuous, and assertsmake_rulesreturns the same rules for both. It closes mutant c4 (\r(?!\n)→\r), which before failed only on a CRLF checkout.Tests
One file per process,
uv run pytest -q -p no:cacheprovider <file>:cc0157f)tests/core/test_release_tagging.pytests/core/test_docs_deployment.pyWith the root
Makefileconverted to CRLF (bytes\n→\r\n, as a CRLF checkout gives),test_release_tagging.pyat this head gives 110 passed.ruff format --checkandruff checkpass on the test file.Mutants
Each mutant edits
MAKE_LINE_BREAK_MAKE_IGNORESin a scratch copy, runstest_release_tagging.pyin its own process on the LFMakefile, and restores the file. The file matched the original after each one.\r(?!\n)→\rtest_make_rules_reads_crlf_makefile_as_lf\vtest_make_rules_rejects_each_line_break_make_ignores[\x0b]\x1c-\x1e\x85and U+2028/U+2029...[\x1c],[\x1d],[\x1e],[\x85],[\u2028],[\u2029]CI
Pull request run 41965682770 at
339c7f7passes all 19 jobs: Check changelog fragment, Lint, Lint workflows,Teston ubuntu-latest and windows-latest for Python 3.11–3.14, andTest Core and country packageson both OSes for Python 3.11–3.14. Each WindowsTestjob rantests\core\test_release_tagging.pyas 4 skipped and 106 passed (110 tests), so both new tests ran on Windows.🤖 Generated with Claude Code