From 1fa927a41b46edb653a4e563d2ad8cc0d8ff63b1 Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Sat, 19 Sep 2026 15:26:02 -0700 Subject: [PATCH 1/2] Read a Key and Its Value in a Comment as Configuration (#1702) `comment-case` reports a comment line whose sentence opens in lowercase, and a configuration snippet pasted into a comment opens on a lowercase key, so no form of one could pass. The rule and a copy-pasteable snippet were mutually exclusive. A comment body of one key, a colon and one value is now configuration rather than a sentence, and neither that rule nor `comment-wrap` applies to it. It sits beside the lone-key exemption, which already covered the `# packages:` line above the one that failed. Clearing the wrap with it is what a multi-line snippet needs, each snippet line no longer reading as a continuation of the one above it. The guard reads its own terminator set rather than `SENT_END`, whose set carries the colon. A colon ends configuration rather than a sentence here, which is why the lone-key exemption exists, and reading it as a terminator refused `address: fd00::`, `image: ghcr.io/o/n:` and `root: C:`. Two detections are lost and one shape is refused, each stated where the pattern is. A marker comment such as `todo: refactor` is the common loss, since it is the same shape as a config line. A sentence wrapping through such a body loses its wrap. And a value ending in a full stop is refused, an FQDN being the case, which loses no detection but removes none either. `is_comment_prose` deliberately does not carry the exemption, unlike its three siblings, since `comment-added` reads a body of any case and exempting the shape there would free `Owner: alice` from the label as well. Measured over the tree the exemption changes no finding and newly reaches one body, a command to paste. --- .github/actions/prose-gate/prose_lint.py | 27 ++++++ scripts/README.md | 2 + scripts/tests/test_prose_lint.py | 112 +++++++++++++++++++++++ 3 files changed, 141 insertions(+) diff --git a/.github/actions/prose-gate/prose_lint.py b/.github/actions/prose-gate/prose_lint.py index 9fc278771..35cfd7ce4 100755 --- a/.github/actions/prose-gate/prose_lint.py +++ b/.github/actions/prose-gate/prose_lint.py @@ -1522,6 +1522,32 @@ def resume_at(carry: Carried, line: str) -> tuple[Carried, int | None]: # The token count carries the test, since a colon ending real prose always has words before it. KEY_ONLY = re.compile(r"^\S+:$") +# One key, a colon, and one value is a line of configuration a reader pastes, not a sentence. +# `comment-case` reads the first character, so every key opening lowercase was rejected. +# The keys that passed are the ones opening on anything else, and each changes what is pasted. +# A capitalized key changes the key, and a quoted or underscored one changes how it is written. +# A leading dash is a different YAML construct from the mapping the line belongs to. +# The same snippet already passes inside a Markdown fence, which is what makes this a gap. +# A value carrying a space is not exempt, which keeps the shape to a key-value line. +# A body ending as a sentence is judged as one, which is the guard `is_tool_directive` pairs. +# It pairs that guard because an anchor alone let such a body exempt itself. +# `SNIPPET_END` rather than `SENT_END`, whose set carries the colon. +# A colon ends configuration rather than a sentence here, which is why `KEY_ONLY` exists above. +# Read with the colon in, `address: fd00::` and `image: ghcr.io/o/n:` were refused. +# The exemption costs two detections and the guard refuses one shape, all stated here. +# The common cost is a marker comment, `todo: refactor` and `note: obsolete` being exempt now. +# The second is a two-token body with no terminator inside a sentence that wraps. +# A sentence wrapping through one reports the line under it for case instead of the wrap. +# A sentence ending on one loses its wrap with nothing reported at all. +# The guard refuses a value ending in a full stop, an FQDN being the case. +# `SNIPPET_END` cannot drop the full stop without dropping the guard, so that finding stands. +# This repository carries no instance of any of the three, so measuring it bounds none of them. +# `is_comment_prose` deliberately does not carry this exemption, unlike its three siblings. +# `comment-added` reads a body of any case, so exempting the shape there frees `Owner: alice`. +# Pricing an added comment is what that rule is for. +SNIPPET = re.compile(r"^\S+:\s+\S+$") +SNIPPET_END = re.compile(r"[.!?][\"')\]]?\s*$") + # A label opening a definition names the thing being defined, so it is not the sentence's first word. # `# publish - 'true' when ...` documents an output named `publish`. # Capitalizing it renames the output the workflow declares. @@ -1860,6 +1886,7 @@ def comment_wrap_findings(path: Path, raw: str, lines: list[str]) -> list[tuple[ or NOT_PROSE.search(body) or BARE_URI.match(body.strip()) or KEY_ONLY.match(body) + or (SNIPPET.match(body) and not SNIPPET_END.search(body)) ): prev_body = "" continue diff --git a/scripts/README.md b/scripts/README.md index 1b4a323d1..9e7129dd5 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -97,6 +97,8 @@ A comment sentence also has to start with a capital, which `comment-case` checks **A comment body that is one token closing on a colon is a key or a heading rather than a sentence**, and neither rule applies to it. A `# ignore:` heading a commented-out block is disabled configuration, so the capitalization `comment-case` asks for corrupts the key a reader uncomments, and the rule damages the file it was pointed at. The token count carries the test, because a colon ending real prose always has words before it. Measured over this repo, the shape matches exactly two bodies, both of them a key or a heading, where the broader reading of a body with no whitespace at all covers 99 and sweeps in every reference URI and version marker with them. +**A comment body of one key, a colon and one value is configuration rather than a sentence**, and neither rule applies to it. `comment-case` reads the first character, so a snippet pasted into a comment could not pass while its key opened lowercase, and the keys that did pass are the ones opening on something else, each changing what a reader pastes: a capitalized, quoted or underscored key changes the key, and a leading dash is a different YAML construct from the mapping it belongs to. The same snippet already passes inside a Markdown fence, which is what makes this a gap rather than a constraint. The shape is one value carrying no space, and a body ending as a sentence is judged as one, the guard `is_tool_directive` pairs with its own anchor and for the same reason. That guard reads its own terminator set rather than `SENT_END`, whose set carries the colon: a colon ends configuration rather than a sentence here, which is why the lone-key exemption above exists, and reading it as a terminator refused `address: fd00::` and `image: ghcr.io/o/n:`. The exemption costs two detections and the guard refuses one shape, all stated rather than left to be found. The common cost is a marker comment, since `todo: refactor` and `note: obsolete` are the same shape as a config line. The second is a two-token body with no terminator inside a wrapping sentence, which loses that sentence its wrap and reports the line under it for case instead, or loses it silently where the body ends the wrap. The refusal is not a lost detection but a finding the exemption fails to remove: a value ending in a full stop is judged as before, an FQDN such as `origin: example.com.` being the case, and that set cannot drop the full stop without dropping the guard. `is_comment_prose` deliberately does not carry this exemption, unlike its three siblings, since `comment-added` reads a body of any case and exempting the shape there would free `Owner: alice` from the label as well. Measured over this repository the exemption newly reaches one body, a command to paste, and that measurement bounds neither cost nor the refusal, this tree carrying no instance of any of them. + **A label opening a definition is exempt from `comment-case`, because the lowercase word is the name being defined.** A `# publish - 'true' when ...` documents an output named `publish`, and capitalizing it renames the output the workflow declares. This is the comment spelling of the `- **Label** - text` construct the dash rule already exempts, and it is the same reason a step marker is stripped before the sentence checks. The exemption costs a detection, stated rather than left to be found: a comment that genuinely opens a sentence on one word followed by a spaced dash is no longer read as a lowercase opening. It is scoped to a line that opens a definition and is never applied to one continuing a wrapped sentence, since a continuation whose first word takes a spaced dash is a parenthetical, which is the construction the dash rule exists to catch. Both live instances in this repo are continuations, so the corpus rather than the intuition chose the unit: the first design read any comment body and would have exempted both. **A comment whose whole body is a URI is a reference rather than a sentence**, and neither rule applies to it. It cannot be capitalized or restructured without corrupting the address it exists to carry, so before the exemption every repo carrying a reference block inherited a finding no edit could answer. Consecutive reference lines are separate addresses rather than one sentence wrapping, which is why the exemption also stops the line below a URI from reading as its continuation. A URI inside a sentence is still prose, so the exemption requires the whole body to be the address and nothing else. diff --git a/scripts/tests/test_prose_lint.py b/scripts/tests/test_prose_lint.py index 0e867ceee..e689cc4c7 100755 --- a/scripts/tests/test_prose_lint.py +++ b/scripts/tests/test_prose_lint.py @@ -822,6 +822,118 @@ def test_a_commented_out_key_is_not_a_sentence(self) -> None: with self.subTest(text=text.splitlines()[0]): self.assertEqual([], self.flag("a.yml", text)) + def test_a_key_and_its_value_are_configuration_rather_than_a_sentence(self) -> None: + """`comment-case` reads the first character, so a key opening lowercase could not pass. + + The reported case is the `External usage:` header a fleet of ESPHome templates carries. + `# packages:` was already exempt as a lone key and the line under it was not. What passed + is any key opening on something other than a lowercase letter, and each such spelling + changes what a reader pastes: a capitalized, quoted or underscored key changes the key, + and a leading dash is a different YAML construct from the mapping it belongs to. The same + snippet already passes inside a Markdown fence. + """ + header = ( + "# External usage:\n" + "# packages:\n" + "# device: github://ptr727/ESPHome-Config/templates/x.yaml@main\n" + ) + self.assertEqual([], self.flag("a.yml", header)) + # Two snippet lines running together are two snippet lines, not a wrapped sentence. + self.assertEqual([], self.flag("b.yml", "# Wiring:\n# sda: GPIO17\n# scl: GPIO16\n")) + + def test_a_value_carrying_a_space_is_still_judged(self) -> None: + """The shape is one key and one value, which is what keeps prose inside the rule.""" + self.assertEqual(["comment-case"], self.flag("a.yml", "# note: this value has spaces\n")) + + def test_the_shape_needs_the_space_after_its_colon(self) -> None: + """The space is the shape rather than decoration, a key and a value being two tokens. + + An empty key is not asserted here: a body opening on its colon opens on no lowercase + letter, so `comment-case` never reads it and widening the key would pin nothing. + """ + self.assertEqual(["comment-case"], self.flag("a.yml", "# key:value\n")) + + def test_a_two_token_body_punctuated_as_a_sentence_is_still_judged(self) -> None: + """Without the guard the shape exempts any two-word sentence. + + It silenced a real wrapped sentence whose continuation happened to be two tokens. + `is_tool_directive` pairs its own anchor with this same guard, for this same failure. + The guard does cost: a value ending in a full stop is refused, `origin: example.com.` + being the case, and `SNIPPET_END` cannot drop the full stop without dropping the guard. + """ + for body in ("# one: two.\n", "# conclusion: wrong!\n", "# result: unchanged.\n"): + with self.subTest(body=body.strip()): + self.assertEqual(["comment-case"], self.flag("a.yml", body)) + self.assertEqual( + ["comment-wrap"], + self.flag("b.yml", "# The rule reads the file at\n# hand: correctly.\n"), + ) + + def test_a_punctuated_markdown_html_comment_is_still_prose(self) -> None: + """That branch keeps a punctuated HTML comment deliberately, and this must not take it.""" + self.assertEqual( + ["comment-case"], self.flag("a.md", "Text.\n\n\n") + ) + + def test_a_sentence_wrapping_through_a_snippet_line_loses_its_wrap(self) -> None: + """One of the exemption's costs, pinned so a later change meets it rather than finds it. + + A two-token body carrying no terminator is exempt wherever it sits. A sentence wrapping + through one loses the wrap and the line under it is reported for case instead, and a + sentence ending on one loses the wrap with no finding at all, which is the quieter half. + The sentence guard cannot reach either, the body ending in no punctuation. + """ + self.assertEqual([], self.flag("c.yml", "# The value the hook reads is\n# empty: false\n")) + self.assertEqual( + ["comment-case"], + self.flag("a.yml", "# The value the hook reads is\n# empty: false\n# by default.\n"), + ) + + def test_the_exemption_holds_in_every_comment_syntax(self) -> None: + """One case per syntax, so a failure names the language whose extractor broke. + + Seven file names covering six specs proved nothing about the markers they never used. + These eleven reach ten of the eleven syntaxes the table declares, the kicad spec being the + one neither this case nor the run-on case beside it reaches. + """ + snippet = "sda: GPIO17" + for name, text in ( + ("a.cs", f"// Wiring:\n// {snippet}\n"), + ("a.c", f"/* Wiring: */\n/* {snippet} */\n"), + ("a.py", f"# Wiring:\n# {snippet}\n"), + ("a.sh", f"# Wiring:\n# {snippet}\n"), + ("a.ps1", f"<# Wiring: #>\n<# {snippet} #>\n"), + ("a.yml", f"# Wiring:\n# {snippet}\n"), + ("a.toml", f"# Wiring:\n# {snippet}\n"), + ("a.ini", f"; Wiring:\n; {snippet}\n"), + ("a.jsonc", f"// Wiring:\n// {snippet}\n"), + ("a.xml", f"\n\n"), + ("a.css", f"/* Wiring: */\n/* {snippet} */\n"), + ): + with self.subTest(file=name, syntax=text.strip()[:12]): + self.assertEqual([], self.flag(name, text)) + + def test_a_value_ending_in_a_colon_is_still_configuration(self) -> None: + """A colon ends configuration rather than a sentence, which is why `KEY_ONLY` exists. + + Guarded with `SENT_END`, whose set carries the colon, an address, an image tag and a + drive letter were each refused and told to capitalize their key, which is the finding + this exemption exists to remove. + """ + for value in ("fd00::", "ghcr.io/o/n:", "C:"): + with self.subTest(value=value): + self.assertEqual([], self.flag("a.yml", f"# Paths:\n# root: {value}\n")) + + def test_a_marker_comment_is_exempt_which_is_the_common_cost(self) -> None: + """The shape cannot tell a two-token marker from a two-token config line. + + This is the cost the rule pays most often, pinned so a later change meets it rather than + discovers it. Narrowing it needs a reading of the value, which is a rule of its own. + """ + for body in ("# todo: refactor\n", "# note: obsolete\n", "# fixme: later\n"): + with self.subTest(body=body.strip()): + self.assertEqual([], self.flag("a.yml", body)) + def test_a_colon_ending_real_prose_is_still_judged(self) -> None: """The exemption is one token wide, since prose closing on a colon has words before it.""" self.assertEqual(["comment-case"], self.flag("a.yml", "# the outputs are these:\n")) From 4f0418b6a252353ab543cbfb25c9cf6148d93398 Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Sat, 19 Sep 2026 17:09:32 -0700 Subject: [PATCH 2/2] Name SNIPPET_END on the Script Reference Too (#1705) Answers the one review thread on the promotion #1704. `scripts/README.md` ended a sentence with "that set cannot drop the full stop without dropping the guard". The nearest prior set in that paragraph is `SENT_END`'s, introduced by the same sentence that contrasts the two, so the claim read as being about the wrong set and is false of it: dropping the full stop from `SENT_END` has no bearing on this guard. It now names `SNIPPET_END`, which the code comment and the test docstring already did. A grep for the sentence confirms all three surfaces state it the same way. ## Two open, recorded rather than fixed A local pass over this commit found two more in the same paragraph. Neither affects behavior and neither is what the promotion thread raised, so they are written down here rather than taken in a further round. - **One clause earlier, the same mis-binding.** "a body ending as a sentence is judged as one, the guard `is_tool_directive` pairs with its own anchor and for the same reason. That guard reads its own terminator set rather than `SENT_END`". The nearest referent for "That guard" is the guard `is_tool_directive` pairs with, and that guard *is* `SENT_END`, so as written the sentence says `SENT_END` reads a set other than itself. The code comment avoids it by naming `SNIPPET_END` at the contrast point; the README names it four sentences later. - **An overstatement on all three surfaces.** "`SNIPPET_END` cannot drop the full stop without dropping the guard" is not true of the pattern. Dropping `.` leaves `[!?]["')\]]?\s*$`, which still refuses `conclusion: wrong!`, one of the bodies the suite pins as judged. The guard would be narrowed rather than dropped. The true claim is narrower: dropping the full stop would re-exempt the wrapped-sentence case the guard exists for, `hand: correctly.`, which is the same shape as the refused `origin: example.com.`. The second is the one worth fixing, and it is a three-surface change rather than a one-line one. Closes on promotion: nothing of its own. This exists to unblock #1704. --- .github/actions/prose-gate/prose_lint.py | 10 ++++++---- scripts/README.md | 2 +- scripts/tests/test_prose_lint.py | 5 +++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/actions/prose-gate/prose_lint.py b/.github/actions/prose-gate/prose_lint.py index 35cfd7ce4..f04f84b52 100755 --- a/.github/actions/prose-gate/prose_lint.py +++ b/.github/actions/prose-gate/prose_lint.py @@ -1529,9 +1529,9 @@ def resume_at(carry: Carried, line: str) -> tuple[Carried, int | None]: # A leading dash is a different YAML construct from the mapping the line belongs to. # The same snippet already passes inside a Markdown fence, which is what makes this a gap. # A value carrying a space is not exempt, which keeps the shape to a key-value line. -# A body ending as a sentence is judged as one, which is the guard `is_tool_directive` pairs. -# It pairs that guard because an anchor alone let such a body exempt itself. -# `SNIPPET_END` rather than `SENT_END`, whose set carries the colon. +# A body ending as a sentence is judged as one, the exemption pairing a guard with its anchor. +# `is_tool_directive` pairs one for the same reason, an anchor alone having exempted such a body. +# The exemption reads `SNIPPET_END` rather than `SENT_END`, whose set carries the colon. # A colon ends configuration rather than a sentence here, which is why `KEY_ONLY` exists above. # Read with the colon in, `address: fd00::` and `image: ghcr.io/o/n:` were refused. # The exemption costs two detections and the guard refuses one shape, all stated here. @@ -1540,7 +1540,9 @@ def resume_at(carry: Carried, line: str) -> tuple[Carried, int | None]: # A sentence wrapping through one reports the line under it for case instead of the wrap. # A sentence ending on one loses its wrap with nothing reported at all. # The guard refuses a value ending in a full stop, an FQDN being the case. -# `SNIPPET_END` cannot drop the full stop without dropping the guard, so that finding stands. +# Dropping the full stop from `SNIPPET_END` leaves `!` and `?` guarded. +# It re-exempts a wrapped sentence whose continuation ends in one, which the guard is for. +# So the full stop stays in that set, and the refusal of an FQDN stands with it. # This repository carries no instance of any of the three, so measuring it bounds none of them. # `is_comment_prose` deliberately does not carry this exemption, unlike its three siblings. # `comment-added` reads a body of any case, so exempting the shape there frees `Owner: alice`. diff --git a/scripts/README.md b/scripts/README.md index 9e7129dd5..86be178cc 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -97,7 +97,7 @@ A comment sentence also has to start with a capital, which `comment-case` checks **A comment body that is one token closing on a colon is a key or a heading rather than a sentence**, and neither rule applies to it. A `# ignore:` heading a commented-out block is disabled configuration, so the capitalization `comment-case` asks for corrupts the key a reader uncomments, and the rule damages the file it was pointed at. The token count carries the test, because a colon ending real prose always has words before it. Measured over this repo, the shape matches exactly two bodies, both of them a key or a heading, where the broader reading of a body with no whitespace at all covers 99 and sweeps in every reference URI and version marker with them. -**A comment body of one key, a colon and one value is configuration rather than a sentence**, and neither rule applies to it. `comment-case` reads the first character, so a snippet pasted into a comment could not pass while its key opened lowercase, and the keys that did pass are the ones opening on something else, each changing what a reader pastes: a capitalized, quoted or underscored key changes the key, and a leading dash is a different YAML construct from the mapping it belongs to. The same snippet already passes inside a Markdown fence, which is what makes this a gap rather than a constraint. The shape is one value carrying no space, and a body ending as a sentence is judged as one, the guard `is_tool_directive` pairs with its own anchor and for the same reason. That guard reads its own terminator set rather than `SENT_END`, whose set carries the colon: a colon ends configuration rather than a sentence here, which is why the lone-key exemption above exists, and reading it as a terminator refused `address: fd00::` and `image: ghcr.io/o/n:`. The exemption costs two detections and the guard refuses one shape, all stated rather than left to be found. The common cost is a marker comment, since `todo: refactor` and `note: obsolete` are the same shape as a config line. The second is a two-token body with no terminator inside a wrapping sentence, which loses that sentence its wrap and reports the line under it for case instead, or loses it silently where the body ends the wrap. The refusal is not a lost detection but a finding the exemption fails to remove: a value ending in a full stop is judged as before, an FQDN such as `origin: example.com.` being the case, and that set cannot drop the full stop without dropping the guard. `is_comment_prose` deliberately does not carry this exemption, unlike its three siblings, since `comment-added` reads a body of any case and exempting the shape there would free `Owner: alice` from the label as well. Measured over this repository the exemption newly reaches one body, a command to paste, and that measurement bounds neither cost nor the refusal, this tree carrying no instance of any of them. +**A comment body of one key, a colon and one value is configuration rather than a sentence**, and neither rule applies to it. `comment-case` reads the first character, so a snippet pasted into a comment could not pass while its key opened lowercase, and the keys that did pass are the ones opening on something else, each changing what a reader pastes: a capitalized, quoted or underscored key changes the key, and a leading dash is a different YAML construct from the mapping it belongs to. The same snippet already passes inside a Markdown fence, which is what makes this a gap rather than a constraint. The shape is one value carrying no space, and a body ending as a sentence is judged as one, the exemption pairing a guard with its own anchor as `is_tool_directive` does and for the same reason. The exemption reads `SNIPPET_END` rather than `SENT_END`, whose set carries the colon: a colon ends configuration rather than a sentence here, which is why the lone-key exemption above exists, and reading it as a terminator refused `address: fd00::` and `image: ghcr.io/o/n:`. The exemption costs two detections and the guard refuses one shape, all stated rather than left to be found. The common cost is a marker comment, since `todo: refactor` and `note: obsolete` are the same shape as a config line. The second is a two-token body with no terminator inside a wrapping sentence, which loses that sentence its wrap and reports the line under it for case instead, or loses it silently where the body ends the wrap. The refusal is not a lost detection but a finding the exemption fails to remove: a value ending in a full stop is judged as before, an FQDN such as `origin: example.com.` being the case. Dropping the full stop from `SNIPPET_END` would leave `!` and `?` guarded and re-exempt the wrapped sentence the guard exists for, so it stays. `is_comment_prose` deliberately does not carry this exemption, unlike its three siblings, since `comment-added` reads a body of any case and exempting the shape there would free `Owner: alice` from the label as well. Measured over this repository the exemption newly reaches one body, a command to paste, and that measurement bounds neither cost nor the refusal, this tree carrying no instance of any of them. **A label opening a definition is exempt from `comment-case`, because the lowercase word is the name being defined.** A `# publish - 'true' when ...` documents an output named `publish`, and capitalizing it renames the output the workflow declares. This is the comment spelling of the `- **Label** - text` construct the dash rule already exempts, and it is the same reason a step marker is stripped before the sentence checks. The exemption costs a detection, stated rather than left to be found: a comment that genuinely opens a sentence on one word followed by a spaced dash is no longer read as a lowercase opening. It is scoped to a line that opens a definition and is never applied to one continuing a wrapped sentence, since a continuation whose first word takes a spaced dash is a parenthetical, which is the construction the dash rule exists to catch. Both live instances in this repo are continuations, so the corpus rather than the intuition chose the unit: the first design read any comment body and would have exempted both. diff --git a/scripts/tests/test_prose_lint.py b/scripts/tests/test_prose_lint.py index e689cc4c7..674d9aa45 100755 --- a/scripts/tests/test_prose_lint.py +++ b/scripts/tests/test_prose_lint.py @@ -857,9 +857,10 @@ def test_a_two_token_body_punctuated_as_a_sentence_is_still_judged(self) -> None """Without the guard the shape exempts any two-word sentence. It silenced a real wrapped sentence whose continuation happened to be two tokens. - `is_tool_directive` pairs its own anchor with this same guard, for this same failure. + `is_tool_directive` pairs a guard with its own anchor the same way, for the same failure. The guard does cost: a value ending in a full stop is refused, `origin: example.com.` - being the case, and `SNIPPET_END` cannot drop the full stop without dropping the guard. + being the case. Dropping the full stop from `SNIPPET_END` would re-exempt the wrapped + sentence the guard exists for, so it stays. """ for body in ("# one: two.\n", "# conclusion: wrong!\n", "# result: unchanged.\n"): with self.subTest(body=body.strip()):