Add -f colored to force colors

pull/139/head
sedrubal 7 years ago
parent dc4a9f4fff
commit 62eab8a284
No known key found for this signature in database
GPG Key ID: B83D4C8CEB8ABFF6

@ -96,8 +96,8 @@ def run(argv=None):
action='store', action='store',
help='custom configuration (as YAML source)') help='custom configuration (as YAML source)')
parser.add_argument('-f', '--format', parser.add_argument('-f', '--format',
choices=('parsable', 'standard'), default='standard', choices=('parsable', 'standard', 'colored'),
help='format for parsing output') default='standard', help='format for parsing output')
parser.add_argument('-s', '--strict', parser.add_argument('-s', '--strict',
action='store_true', action='store_true',
help='return non-zero exit code on warnings ' help='return non-zero exit code on warnings '
@ -143,7 +143,7 @@ def run(argv=None):
for problem in linter.run(f, conf, filepath): for problem in linter.run(f, conf, filepath):
if args.format == 'parsable': if args.format == 'parsable':
print(Format.parsable(problem, file)) print(Format.parsable(problem, file))
elif supports_color(): elif supports_color() or args.format == 'colored':
if first: if first:
print('\033[4m%s\033[0m' % file) print('\033[4m%s\033[0m' % file)
first = False first = False

Loading…
Cancel
Save