adjust error outputs to be more standardized
diff --git a/pre_commit_hooks/check_merge_conflict.py b/pre_commit_hooks/check_merge_conflict.py
index 22031a2..15ec284 100644
--- a/pre_commit_hooks/check_merge_conflict.py
+++ b/pre_commit_hooks/check_merge_conflict.py
@@ -10,6 +10,7 @@
CONFLICT_PATTERNS = [
b'<<<<<<< ',
b'======= ',
+ b'=======\r\n',
b'=======\n',
b'>>>>>>> ',
]
@@ -39,12 +40,12 @@
retcode = 0
for filename in args.filenames:
with open(filename, 'rb') as inputfile:
- for i, line in enumerate(inputfile):
+ for i, line in enumerate(inputfile, start=1):
for pattern in CONFLICT_PATTERNS:
if line.startswith(pattern):
print(
- f'Merge conflict string "{pattern.decode()}" '
- f'found in {filename}:{i + 1}',
+ f'{filename}:{i}: Merge conflict string '
+ f'{pattern.strip().decode()!r} found',
)
retcode = 1