mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Overwrite default value of --color argument with PRE_COMMIT_COLOR env var
This commit is contained in:
parent
c75d8939f8
commit
aaa249bda9
1 changed files with 2 additions and 1 deletions
|
|
@ -38,7 +38,8 @@ os.environ.pop('__PYVENV_LAUNCHER__', None)
|
||||||
|
|
||||||
def _add_color_option(parser):
|
def _add_color_option(parser):
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--color', default='auto', type=color.use_color,
|
'--color', default=os.environ.get('PRE_COMMIT_COLOR', 'auto'),
|
||||||
|
type=color.use_color,
|
||||||
metavar='{' + ','.join(color.COLOR_CHOICES) + '}',
|
metavar='{' + ','.join(color.COLOR_CHOICES) + '}',
|
||||||
help='Whether to use color in output. Defaults to `%(default)s`.',
|
help='Whether to use color in output. Defaults to `%(default)s`.',
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue