From e941b90ac953df6056fd2ed7b85fe78bc07bc0e1 Mon Sep 17 00:00:00 2001 From: josh11b Date: Thu, 22 Sep 2022 08:20:07 -0700 Subject: [PATCH] Correctly remove `## TODO` section from proposals (#2207) Fix bug introduced in #2139 --- proposals/scripts/new_proposal.py | 2 +- proposals/scripts/new_proposal_test.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/proposals/scripts/new_proposal.py b/proposals/scripts/new_proposal.py index fd8e5fe2d8cb..70c79f38d873 100755 --- a/proposals/scripts/new_proposal.py +++ b/proposals/scripts/new_proposal.py @@ -98,7 +98,7 @@ def _fill_template(template_path: str, title: str, pr_num: int) -> str: r"\g<1>%d" % pr_num, content, ) - content = re.sub(r"\n## TODO(?:|\n)*?(\n## )", r"\1", content) + content = re.sub(r"\n## TODO(?:.|\n)*?(\n## )", r"\1", content) return content diff --git a/proposals/scripts/new_proposal_test.py b/proposals/scripts/new_proposal_test.py index 4b287b7c56b3..30751fce0a16 100644 --- a/proposals/scripts/new_proposal_test.py +++ b/proposals/scripts/new_proposal_test.py @@ -50,7 +50,9 @@ class TestNewProposal(unittest.TestCase): "pull/123)" in content, content, ) - self.assertTrue("\n## Abstract\n\n" in content, content) + self.assertTrue( + "\n\n## Abstract\n\n" in content, content + ) def test_run_success(self): new_proposal._run(["true"])