Auto-change output format if GitHub Actions detected

This commit is contained in:
Andrew Imeson
2020-09-22 23:23:24 -04:00
committed by Adrien Vergé
parent 50c7453824
commit 67cb4eb24d
3 changed files with 55 additions and 1 deletions

View File

@@ -109,7 +109,9 @@ def show_problems(problems, file, args_format, no_warn):
continue
if args_format == 'parsable':
print(Format.parsable(problem, file))
elif args_format == 'github':
elif args_format == 'github' or (args_format == 'auto' and
'GITHUB_ACTIONS' in os.environ and
'GITHUB_WORKFLOW' in os.environ):
print(Format.github(problem, file))
elif args_format == 'colored' or \
(args_format == 'auto' and supports_color()):