mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Fix linters
This commit is contained in:
parent
2d57068f49
commit
3793bc32c0
2 changed files with 4 additions and 1 deletions
|
|
@ -26,16 +26,18 @@ def _process_filename_by_line(pattern, filename):
|
|||
output.write_line(line.rstrip(b'\r\n'))
|
||||
return retv
|
||||
|
||||
|
||||
def _process_filename_at_once(pattern, filename):
|
||||
retv = 0
|
||||
with open(filename, 'rb') as f:
|
||||
match = pattern.search(f.read().decode('utf-8').replace('\n',''))
|
||||
match = pattern.search(f.read().decode('utf-8').replace('\n', ''))
|
||||
if match:
|
||||
retv = 1
|
||||
output.write('{}:'.format(filename))
|
||||
output.write_line(match.group())
|
||||
return retv
|
||||
|
||||
|
||||
def run_hook(prefix, hook, file_args):
|
||||
exe = (sys.executable, '-m', __name__)
|
||||
exe += tuple(hook['args']) + (hook['entry'],)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue