remove redundant json-calls

pull/245/head
Roman v. Gemmeren 5 years ago
parent 09ec4d3ee7
commit 2c52058530
No known key found for this signature in database
GPG Key ID: 630038BE768F4344

@ -87,13 +87,13 @@ class Format(object):
@staticmethod @staticmethod
def json(problem, filename): def json(problem, filename):
return json.dumps({ return {
"path": filename, "path": filename,
"line": problem.line, "line": problem.line,
"char": problem.column, "char": problem.column,
"description": problem.message, "description": problem.message,
"severity": problem.level, "severity": problem.level,
}) }
def show_problems(problems, file, args_format, no_warn): def show_problems(problems, file, args_format, no_warn):
max_level = 0 max_level = 0
@ -107,7 +107,7 @@ def show_problems(problems, file, args_format, no_warn):
if args_format == 'parsable': if args_format == 'parsable':
print(Format.parsable(problem, file)) print(Format.parsable(problem, file))
elif args_format == 'json': elif args_format == 'json':
problems_json.append(json.loads(Format.json(problem, file))) problems_json.append(Format.json(problem, file))
elif args_format == 'colored' or \ elif args_format == 'colored' or \
(args_format == 'auto' and supports_color()): (args_format == 'auto' and supports_color()):
if first: if first:

Loading…
Cancel
Save