Repository navigation
tests/test_doctor_legs_members_next.py: the fixed words of the explanations its checkout scenarios reach are held clear of shell syntax over a root that needs quoting, and the file says the PowerShell form of a line is checked as text, by two tests, and run by no job (#415) - #899
Conversation
… are held clear of `;`, `'`, a backtick and a parenthesis over a root whose path needs quoting, and each keep line is read back by `shlex` as one path, so a `'` in the words fails and the quoting of a path does not, and the file says the PowerShell form of a line is checked as text and run by no job (#415) N7. The test that the sentence holds none of the five characters read the whole `why` over pytest's temporary roots, which need no quoting, so it held by accident: over a root with a space the detached leg's keep line is `git -C '<root>/spec' branch NAME`, and the old test fails on its `'` (measured: 4 of 5 scenarios pass, the detached one fails). It is now `test_the_explanations_fixed_words_hold_no_shell_syntax_over_a_quoted_root`, over a copy of the project at `my atlas` and at `do ct'or` (a space and an apostrophe). Each path the sentence names is put as `PATH` before the words are read (`assert_fixed_words_are_plain`), and the keep line is read as `sh` reads it: `shlex.split` gives `git -C <mount> branch NAME` with the mount as one argument. Mutants in shape-doctor.py, each restored after: a `'` in the words every scenario carries (`isn't`) and a `'` only in the keep-line sentence (`one's`) fail the new test, and so does a keep line whose path is not quoted, which the old test passes over pytest's roots. The same whole- sentence loop at three more sites (the members git line, #413 a and #413 c) is replaced by a call of the same helper. N6. The PowerShell form is asserted as text only (`test_the_line_is_spelled_for_the_readers_shell`) and every paste test is `WINDOWS_SKIP`. No Windows-only test is added: `tests.yml` runs the suite on ubuntu-latest alone since #597, and its one Windows job, `tests-git-bash`, runs three launcher and installer files, so a `skipif(os.name != "nt")` test here would be skipped by every runner. The module docstring, the section header and that test's docstring now say so, and that `test_a_template_validators_next_runs_when_pasted_into_powershell` in test_shape_doctor.py, the precedent the issue names, is no better placed. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Reviewer's GuideThe PR revises the doctor explanation tests to distinguish fixed prose from quoted paths, exercising real rows over roots containing spaces and apostrophes and validating copied POSIX commands structurally. It also documents that PowerShell output is checked only as text because this test module has no Windows CI job. File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
…hell form is checked as text by two tests and run by no job, that the text-level tests give way on Windows only where `shlex` or a non-UTF-8 name cannot, and that `assert_fixed_words_are_plain` reads all of `why` where it is passed no path (#415) Review r415 of PR #899 at 1ce9a8c: S1. `test_the_line_is_spelled_for_the_readers_shell` called itself the only check of the PowerShell form. `test_413a_the_kept_repositorys_keep_ line_is_spelled_for_the_readers_shell` asserts the `platform="nt"` spelling of the `--git-dir=` and `--work-tree=` keep line too. Both are named, in that docstring and in the module's, and "no job could" is "no job does". N2. The module docstring said the text-level assertions carry no skip. They give way on Windows in two places of their own: a member named in bytes (the command line cannot carry it) and the keep line of the quoted-root test, whose `shlex` read is skipped there. It says so. N3. `assert_fixed_words_are_plain` said a sentence that names nothing fails. That holds where a path is passed. Passed none, as the members git line is, it reads the whole of `why`, which is the loop it replaced. It says so. N1. The `os.name` skip of that `shlex` read is kept and has its reason: PowerShell doubles an apostrophe, which `shlex` misreads; Git Bash is `host_shell_dialect() == "posix"`, where `shlex` is right; and no job runs this file on Windows today. Docstrings and one comment only: no assertion changes. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ne_is_spelled_for_the_readers_shell` closes the sentence that names the #413 a spelling test with a full stop (#415) The name was on a line of its own, in backticks, and "No test in this file runs the form" followed it with no stop. With the backticks and a stop the line would be 80 columns, so the name is written without them, at 78. The module docstring's paragraph naming both tests reads as one sentence ("`a` and `b` ask `quote_arg` for it") and has no such gap. Docstring only: no code changes. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
(lane openRepoShape-1, 2026-10-18T15:11:52Z) Independent review of #899 (#415), by lane 1's reviewer r415 (sonnet), who is not its writer: READY at Round 1, at
The fix round is docstrings and comments only: Round 2, at
N4 and N5 are left. The title now claims only the explanations the scenarios reach, and the body says why. Lane: openreposhape-1 (openRepoShape-1) |
|
|
Sorry @brettheap, you've used your own review budget of 250,000 diff characters for the last 7 days. You can request another review in 1 day and 7 hours by commenting |



Lane: openreposhape-1 (openRepoShape-1)
Claim: #415 (comment)
A v1.2.0 draft, authored on the v1.1.1 release commit
5017830. Lane 3 placed #415 in v1.2.0 (#473, issuecomment-6250991055). It changestests/test_doctor_legs_members_next.pyonly.shape-doctor.pyis unchanged.N7: the "no character a pasted tail would break on" test held only by accident
The test asserted that the explanation holds none of
;,', a backtick or a parenthesis. That held only because pytest's temporary roots need no quoting. Over a root likemy atlas, the keep line isgit -C '<root>/my atlas/spec' branch NAME, and the old test fails on the'. Lane 1's writer measured this over the detached scenario.Since #415 was filed, #277 has landed. The sentence is the row's
why, on its ownWHYline, and is no longer a pasted#tail.submodule_update_next's docstring now says the no-;'rule "no longer binds it". So the old test claimed more than the code needs.Now:
assert_fixed_words_are_plain(why, *spelled):quote_arg-spelled path is inwhy, so the check cannot pass vacuously;PATH;test_the_explanations_fixed_words_hold_no_shell_syntax_over_a_quoted_root:my atlasanddo ct'or, each a copy of the project, so the doctor's real row is read;why, andshlex.splitof it must give["git", "-C", "<mount>", "branch", "NAME"]. That check is skipped on Windows, where PowerShell doubles an apostrophe.why, as the loop it replaced did.Mutants (in
shape-doctor.py, restored after each):'insubmodule_update_next's fixed words'incheckout_notes's keep-line sentenceNo closing quotation, or a wrong split)N6: the PowerShell form of the line is never run
This is documented, not tested.
tests.ymlruns this file on ubuntu-latest only (ci: run the test suite on Linux only #597). Its one Windows job,tests-git-bash, runs three installer and launcher files. Askipif(os.name != "nt")test in this file would never run in CI.;,', a backtick or a parenthesis" passes only because pytest's temporary roots need no quoting: under a root with a space the same sentence's keep line isgit -C '<root>/spec' branch NAME, as the file's own spelling test expects #415)".shlexread of a quoted root's keep line;test_the_line_is_spelled_for_the_readers_shellsays it is one of two checks of the PowerShell form, both of the text. The other istest_413a_the_kept_repositorys_keep_line_is_spelled_for_the_readers_shell.Left alone: the precedent
tests/test_shape_doctor.py::test_a_template_validators_next_runs_when_pasted_into_powershell(line 10493) is likewise never run by CI. Its docstring still names thetests-windowsjob that #597 dropped. That is outside #415.Review
Lane 1's independent reviewer r415 (sonnet):
1ce9a8c8. SHOULD S1: the docstring called that test "THE ONLY CHECK OF THE POWERSHELL FORM", and there are two. NITs N1 to N5.732696c8(S1, N1, N2 and N3), andfbfcc9e8, which closes S1's sentence with a full stop.fbfcc9e8. Outside docstrings, the AST is unchanged from1ce9a8c8, and each new sentence was checked against the code it names.CHECKOUT_SCENARIOSnever reachesrerun_sentence, sincererunis set only when a pin is missing or differs from the gitlink. A(there survives this test, as it survived the old one. So the title now claims the fixed words of the explanations these scenarios reach, not every explanation.Tests
Run with
/usr/bin/python3 -m pytest, a stubghfirst on PATH, a bogusGH_TOKEN, an emptyGH_CONFIG_DIRandGIT_CONFIG_GLOBAL=/dev/null:tests/test_doctor_legs_members_next.pytests/test_repo_hygiene.pytests/test_doctor_paste_through_git.pyandtests/test_no_auto_maintenance.pyNo added line is over 79 columns, the change is ASCII, and
git diff --checkis clean.Closes #415
🤖 Generated with Claude Code
Summary by Sourcery
Harden doctor explanation tests against shell syntax regressions across quoted roots and clarify the limits of PowerShell coverage.
Bug Fixes:
Enhancements:
Tests: