remove redundant json-calls
This commit is contained in:
@@ -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:
|
||||||
|
|||||||
Reference in New Issue
Block a user