Skip to content

Commit 6ff2d7f

Browse files
committed
flake8 fixes
1 parent b15d6d3 commit 6ff2d7f

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

homu/main.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,12 @@
4343

4444
IGNORE_BLOCK_START = '<!-- homu-ignore:start -->'
4545
IGNORE_BLOCK_END = '<!-- homu-ignore:end -->'
46-
IGNORE_BLOCK_RE = re.compile(r'<!--\s*homu-ignore:start\s*-->.*<!--\s*homu-ignore:end\s*-->',
47-
flags=re.MULTILINE|re.DOTALL|re.IGNORECASE)
46+
IGNORE_BLOCK_RE = re.compile(
47+
r'<!--\s*homu-ignore:start\s*-->'
48+
r'.*'
49+
r'<!--\s*homu-ignore:end\s*-->',
50+
flags=re.MULTILINE | re.DOTALL | re.IGNORECASE
51+
)
4852

4953
global_cfg = {}
5054

@@ -54,6 +58,7 @@
5458
def suppress_pings(text):
5559
return re.sub(r'\B(@\S+)', r'`\g<1>`', text) # noqa
5660

61+
5762
# Replace any text between IGNORE_BLOCK_START and IGNORE_BLOCK_END
5863
# HTML comments with an empty string in merge commits
5964
def suppress_ignore_block(text):

homu/tests/test_pr_body.py

+12-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
from homu.main import suppress_ignore_block, suppress_pings, IGNORE_BLOCK_START, IGNORE_BLOCK_END
1+
from homu.main import (
2+
suppress_ignore_block,
3+
suppress_pings,
4+
IGNORE_BLOCK_START,
5+
IGNORE_BLOCK_END,
6+
)
27

38

49
def test_suppress_pings_in_PR_body():
@@ -16,11 +21,13 @@ def test_suppress_pings_in_PR_body():
1621

1722
assert suppress_pings(body) == expect
1823

24+
1925
def test_suppress_ignore_block_in_PR_body():
20-
body = ("Rollup merge\n"
21-
"{}\n"
22-
"[Create a similar rollup](https://fake.xyz/?prs=1,2,3)\n"
23-
"{}"
26+
body = (
27+
"Rollup merge\n"
28+
"{}\n"
29+
"[Create a similar rollup](https://fake.xyz/?prs=1,2,3)\n"
30+
"{}"
2431
)
2532

2633
body = body.format(IGNORE_BLOCK_START, IGNORE_BLOCK_END)

0 commit comments

Comments
 (0)