mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Replace match.group(n) with match[n]
This commit is contained in:
parent
9000e9dd41
commit
5d767bbc49
2 changed files with 3 additions and 3 deletions
|
|
@ -41,7 +41,7 @@ def _process_filename_at_once(pattern: Pattern[bytes], filename: str) -> int:
|
|||
line_no = contents[:match.start()].count(b'\n')
|
||||
output.write(f'{filename}:{line_no + 1}:')
|
||||
|
||||
matched_lines = match.group().split(b'\n')
|
||||
matched_lines = match[0].split(b'\n')
|
||||
matched_lines[0] = contents.split(b'\n')[line_no]
|
||||
|
||||
output.write_line(b'\n'.join(matched_lines))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue