Skip to content

Commit 04bf47c

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 19609da commit 04bf47c

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

pre_commit_hooks/check_merge_conflict.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def main(argv: Sequence[str] | None = None) -> int:
4343
for i, line in enumerate(inputfile, start=1):
4444
# Look for conflict patterns in order
4545
if line.startswith(
46-
CONFLICT_PATTERNS[expected_conflict_pattern_index]
46+
CONFLICT_PATTERNS[expected_conflict_pattern_index],
4747
):
4848
expected_conflict_pattern_index += 1
4949
if expected_conflict_pattern_index == N:

tests/check_merge_conflict_test.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -113,18 +113,19 @@ def test_merge_conflicts_git(capsys):
113113
# Individual markers are not actually merge conflicts, need 3 markers
114114
# to mark a real conflict
115115
'contents, expected_retcode',
116-
((b'<<<<<<< ', 0),
117-
(b'=======', 0),
118-
(b'>>>>>>> ',0),
119-
# Real conflict marker
120-
(b'<<<<<<< HEAD\n=======\n>>>>>>> branch\n', 1),
121-
# Allow for the possibility of an .rst file with a =======
122-
# inside a conflict marker
123-
(b'<<<<<<< HEAD\n=======\n=======\n>>>>>>> branch\n', 1),
124-
)
116+
(
117+
(b'<<<<<<< ', 0),
118+
(b'=======', 0),
119+
(b'>>>>>>> ', 0),
120+
# Real conflict marker
121+
(b'<<<<<<< HEAD\n=======\n>>>>>>> branch\n', 1),
122+
# Allow for the possibility of an .rst file with a =======
123+
# inside a conflict marker
124+
(b'<<<<<<< HEAD\n=======\n=======\n>>>>>>> branch\n', 1),
125+
),
125126
)
126127
def test_merge_conflicts_with_rst(
127-
contents, expected_retcode, repository_pending_merge
128+
contents, expected_retcode, repository_pending_merge,
128129
):
129130
repository_pending_merge.join('f2.rst').write_binary(contents)
130131
assert main(['f2.rst']) == expected_retcode
@@ -149,14 +150,15 @@ def test_does_not_care_when_not_in_a_merge(tmpdir):
149150
f.write_binary(b'problem\n=======\n')
150151
assert main([str(f.realpath())]) == 0
151152

153+
152154
@pytest.mark.parametrize(
153155
'contents, expected_retcode',
154156
(
155157
# Not a complete conflict marker
156158
(b'=======', 0),
157159
# Complete conflict marker
158160
(b'<<<<<<< HEAD\nproblem\n=======\n>>>>>>> branch\n', 1),
159-
)
161+
),
160162
)
161163
def test_care_when_assumed_merge(contents, expected_retcode, tmpdir):
162164
f = tmpdir.join('README.md')

0 commit comments

Comments
 (0)