Commit b29e0c06 authored by Jérome Perrin's avatar Jérome Perrin

format-json: display filename and error location on error

parent 5c417099
Pipeline #35867 failed with stage
in 0 seconds
......@@ -25,7 +25,7 @@ def main():
obj = json.load(infile, object_pairs_hook=collections.OrderedDict)
except ValueError as e:
exit_code = 1
print(e, file=sys.stderr)
print(f'{f}:{e.lineno}', e, file=sys.stderr)
else:
with open(f, 'w') as outfile:
json.dump(obj, outfile, ensure_ascii=False, sort_keys=False, indent=2, separators=(',', ': '))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment