From 62eab8a28478cbfa4c6702cb95b4cd0a9429b88c Mon Sep 17 00:00:00 2001 From: sedrubal Date: Thu, 18 Oct 2018 17:02:23 +0200 Subject: [PATCH] Add -f colored to force colors --- yamllint/cli.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yamllint/cli.py b/yamllint/cli.py index 0faee16..0d2055d 100644 --- a/yamllint/cli.py +++ b/yamllint/cli.py @@ -96,8 +96,8 @@ def run(argv=None): action='store', help='custom configuration (as YAML source)') parser.add_argument('-f', '--format', - choices=('parsable', 'standard'), default='standard', - help='format for parsing output') + choices=('parsable', 'standard', 'colored'), + default='standard', help='format for parsing output') parser.add_argument('-s', '--strict', action='store_true', help='return non-zero exit code on warnings ' @@ -143,7 +143,7 @@ def run(argv=None): for problem in linter.run(f, conf, filepath): if args.format == 'parsable': print(Format.parsable(problem, file)) - elif supports_color(): + elif supports_color() or args.format == 'colored': if first: print('\033[4m%s\033[0m' % file) first = False