mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
upgrade hooks, pyupgrade pre-commit
This commit is contained in:
parent
764c765d29
commit
30c1e8289f
91 changed files with 176 additions and 437 deletions
|
|
@ -1,5 +1,3 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
|
@ -8,7 +6,7 @@ if os.name == 'nt': # pragma: no cover (windows)
|
|||
from pre_commit.color_windows import enable_virtual_terminal_processing
|
||||
try:
|
||||
enable_virtual_terminal_processing()
|
||||
except WindowsError:
|
||||
except OSError:
|
||||
terminal_supports_color = False
|
||||
|
||||
RED = '\033[41m'
|
||||
|
|
@ -34,7 +32,7 @@ def format_color(text, color, use_color_setting):
|
|||
if not use_color_setting:
|
||||
return text
|
||||
else:
|
||||
return '{}{}{}'.format(color, text, NORMAL)
|
||||
return f'{color}{text}{NORMAL}'
|
||||
|
||||
|
||||
COLOR_CHOICES = ('auto', 'always', 'never')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue