Skip to content

Commit 447e73f

Browse files
committed
Fix indentation
1 parent 375ad52 commit 447e73f

File tree

5 files changed

+30
-38
lines changed

5 files changed

+30
-38
lines changed

.github/workflows/backport.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,3 @@ jobs:
2828
run: python3 -m pip install coverage -U pip -r dev-requirements.txt
2929
- name: Run code
3030
run: python3 -m bedevere.backport
31-
32-

.github/workflows/close_pr.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,3 @@ jobs:
2828
run: python3 -m pip install coverage -U pip -r dev-requirements.txt
2929
- name: Run code
3030
run: python3 -m bedevere.close_pr
31-
32-

.github/workflows/filepaths.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,3 @@ jobs:
2828
run: python3 -m pip install coverage -U pip -r dev-requirements.txt
2929
- name: Run code
3030
run: python3 -m bedevere.filepaths
31-
32-

.github/workflows/review_pr.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,3 @@ jobs:
2828
run: python3 -m pip install coverage -U pip -r dev-requirements.txt
2929
- name: Run code
3030
run: python3 -m bedevere.review_pr
31-
32-

bedevere/backport.py

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,16 @@ async def _remove_backport_label(gh, original_issue, branch, backport_pr_number)
5555
async def manage_labels(gh, *args, **kwargs):
5656
with open(os.environ["GITHUB_EVENT_PATH"]) as f:
5757
event = json.load(f)
58-
if event.get("action") == "edited" and "title" not in event.get("changes"):
59-
return
60-
pull_request = event["pull_request"]
61-
title = util.normalize_title(pull_request['title'],
62-
pull_request['body'])
63-
title_match = TITLE_RE.match(title)
64-
if title_match is None:
65-
return
66-
branch = title_match.group('branch')
67-
original_pr_number = title_match.group('pr')
58+
if event.get("action") == "edited" and "title" not in event.get("changes"):
59+
return
60+
pull_request = event["pull_request"]
61+
title = util.normalize_title(pull_request['title'],
62+
pull_request['body'])
63+
title_match = TITLE_RE.match(title)
64+
if title_match is None:
65+
return
66+
branch = title_match.group('branch')
67+
original_pr_number = title_match.group('pr')
6868

6969
original_issue = await gh.getitem(event['repository']['issues_url'],
7070
{'number': original_pr_number})
@@ -84,26 +84,26 @@ async def validate_maintenance_branch_pr(gh, *args, **kwargs):
8484
"""
8585
with open(os.environ["GITHUB_EVENT_PATH"]) as f:
8686
event = json.load(f)
87-
if event.get("action") == "edited" and "title" not in event.get("changes"):
88-
return
89-
pull_request = event["pull_request"]
90-
base_branch = pull_request["base"]["ref"]
91-
92-
if base_branch == "main":
93-
return
94-
95-
title = util.normalize_title(pull_request["title"],
96-
pull_request["body"])
97-
title_match = MAINTENANCE_BRANCH_TITLE_RE.match(title)
98-
99-
if title_match is None:
100-
status = create_status(util.StatusState.FAILURE,
101-
description="Not a valid maintenance branch PR title.",
102-
target_url=BACKPORT_TITLE_DEVGUIDE_URL)
103-
else:
104-
status = create_status(util.StatusState.SUCCESS,
105-
description="Valid maintenance branch PR title.")
106-
await util.post_status(gh, event, status)
87+
if event.get("action") == "edited" and "title" not in event.get("changes"):
88+
return
89+
pull_request = event["pull_request"]
90+
base_branch = pull_request["base"]["ref"]
91+
92+
if base_branch == "main":
93+
return
94+
95+
title = util.normalize_title(pull_request["title"],
96+
pull_request["body"])
97+
title_match = MAINTENANCE_BRANCH_TITLE_RE.match(title)
98+
99+
if title_match is None:
100+
status = create_status(util.StatusState.FAILURE,
101+
description="Not a valid maintenance branch PR title.",
102+
target_url=BACKPORT_TITLE_DEVGUIDE_URL)
103+
else:
104+
status = create_status(util.StatusState.SUCCESS,
105+
description="Valid maintenance branch PR title.")
106+
await util.post_status(gh, event, status)
107107

108108
async def maintenance_branch_created(gh, *args, **kwargs):
109109
"""Create the `needs backport label` when the maintenance branch is created.

0 commit comments

Comments
 (0)