mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-18 08:34:41 +04:00
Better project structure
This commit is contained in:
parent
f31f092f9b
commit
1746a97e24
52 changed files with 221 additions and 189 deletions
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
import sys
|
||||
|
||||
RED = '\033[41m'
|
||||
|
|
@ -8,18 +7,19 @@ TURQUOISE = '\033[46;30m'
|
|||
NORMAL = '\033[0m'
|
||||
|
||||
|
||||
class InvalidColorSetting(ValueError): pass
|
||||
class InvalidColorSetting(ValueError):
|
||||
pass
|
||||
|
||||
|
||||
def format_color(text, color, use_color):
|
||||
def format_color(text, color, use_color_setting):
|
||||
"""Format text with color.
|
||||
|
||||
Args:
|
||||
text - Text to be formatted with color if `use_color`
|
||||
color - The color start string
|
||||
use_color - Whether or not to color
|
||||
use_color_setting - Whether or not to color
|
||||
"""
|
||||
if not use_color:
|
||||
if not use_color_setting:
|
||||
return text
|
||||
else:
|
||||
return u'{0}{1}{2}'.format(color, text, NORMAL)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue