Skip to content

Commit 0481718

Browse files
author
github-actions
committed
[github-actions] Apply auto-formatting using ruff
1 parent bd570ee commit 0481718

File tree

2 files changed

+20
-17
lines changed

2 files changed

+20
-17
lines changed

merge_squash/tests/test_verify.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
MAIN_COMMITS_INCORRECT,
66
CHANGES_FROM_SUPPORTING_NOT_PRESENT,
77
SQUASH_ON_SUPPORTING,
8-
verify
8+
verify,
99
)
1010

1111
REPOSITORY_NAME = "merge-squash"
@@ -25,12 +25,19 @@ def test_non_squash_merge_used():
2525

2626
def test_not_merged():
2727
with loader.load("specs/not_merged.yml") as output:
28-
assert_output(output, GitAutograderStatus.UNSUCCESSFUL, [CHANGES_FROM_SUPPORTING_NOT_PRESENT])
28+
assert_output(
29+
output,
30+
GitAutograderStatus.UNSUCCESSFUL,
31+
[CHANGES_FROM_SUPPORTING_NOT_PRESENT],
32+
)
2933

3034

3135
def test_missing_main_commits():
3236
with loader.load("specs/missing_main_commits.yml") as output:
33-
assert_output(output, GitAutograderStatus.UNSUCCESSFUL, [MAIN_COMMITS_INCORRECT])
37+
assert_output(
38+
output, GitAutograderStatus.UNSUCCESSFUL, [MAIN_COMMITS_INCORRECT]
39+
)
40+
3441

3542
def test_wrong_branch_squashed():
3643
with loader.load("specs/wrong_branch_squashed.yml") as output:

merge_squash/verify.py

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,17 @@
44
GitAutograderStatus,
55
)
66

7-
SQUASH_NOT_USED = (
8-
"You should be using squash merge, not regular merge."
9-
)
7+
SQUASH_NOT_USED = "You should be using squash merge, not regular merge."
108

11-
MAIN_COMMITS_INCORRECT = (
12-
"The main branch does not contain at least one of these commits: 'Add Joey', 'Add Phoebe' or 'Add Ross'."
13-
)
9+
MAIN_COMMITS_INCORRECT = "The main branch does not contain at least one of these commits: 'Add Joey', 'Add Phoebe' or 'Add Ross'."
1410

1511
CHANGES_FROM_SUPPORTING_NOT_PRESENT = (
1612
"The main branch does not contain both files 'mike.txt' and 'janice.txt'."
1713
)
1814

19-
SQUASH_NOT_COMMITTED = (
20-
"You have not committed the staged files! Remember, you need to manually commit after a squash merge!"
21-
)
15+
SQUASH_NOT_COMMITTED = "You have not committed the staged files! Remember, you need to manually commit after a squash merge!"
2216

23-
SQUASH_ON_SUPPORTING = (
24-
"You are working on the wrong branch! Bring the changes from supporting onto main, not the other way around."
25-
)
17+
SQUASH_ON_SUPPORTING = "You are working on the wrong branch! Bring the changes from supporting onto main, not the other way around."
2618

2719

2820
def verify(exercise: GitAutograderExercise) -> GitAutograderOutput:
@@ -36,7 +28,9 @@ def verify(exercise: GitAutograderExercise) -> GitAutograderOutput:
3628
if janice_file is None:
3729
raise exercise.wrong_answer([CHANGES_FROM_SUPPORTING_NOT_PRESENT])
3830

39-
commit_messages_in_main = [str(c.commit.message.strip()) for c in main_branch.commits]
31+
commit_messages_in_main = [
32+
str(c.commit.message.strip()) for c in main_branch.commits
33+
]
4034
merge_commits = [c for c in main_branch.commits if len(c.parents) > 1]
4135

4236
if merge_commits:
@@ -56,4 +50,6 @@ def verify(exercise: GitAutograderExercise) -> GitAutograderOutput:
5650
except KeyError:
5751
pass
5852

59-
return exercise.to_output(["Good job performing a merge squash!"], GitAutograderStatus.SUCCESSFUL)
53+
return exercise.to_output(
54+
["Good job performing a merge squash!"], GitAutograderStatus.SUCCESSFUL
55+
)

0 commit comments

Comments
 (0)