Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit aaa249b

Browse files
committed
Overwrite default value of --color argument with PRE_COMMIT_COLOR env var
1 parent c75d893 commit aaa249b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

pre_commit/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838

3939
def _add_color_option(parser):
4040
parser.add_argument(
41-
'--color', default='auto', type=color.use_color,
41+
'--color', default=os.environ.get('PRE_COMMIT_COLOR', 'auto'),
42+
type=color.use_color,
4243
metavar='{' + ','.join(color.COLOR_CHOICES) + '}',
4344
help='Whether to use color in output. Defaults to `%(default)s`.',
4445
)

0 commit comments

Comments
 (0)