> How about this formatting, I tend to find it a bit easier to read even. > I also updated the location numbering to be numerical so, removed the quotes. > > Ok for master? > > Thanks, > Tamar > > + elif format == 'json': > + fn = lambda x: x.error_message > + i = 1 > + result = [] > + for (k, errors) in groupby(sorted(errors, key = fn), fn): > + errors = list(errors) > + entry = {} > + entry['type'] = i > + entry['msg'] = k > + entry['count'] = len(errors) > + i += 1 > + errlines = [] > + for e in errors: > + locs = e.error_location ().split(':') > + errlines.append({ "file": locs[0] > + , "row": int(locs[1]) > + , "column": int(locs[2]) > + , "err": e.console_error }) > + entry['errors'] = errlines > + result.append(entry) > + > + if len(errors) == 0: > + exit(0) > + else: > + json_string = json.dumps(result) > + print(json_string) > + exit(1) > else: > assert False
Sure, this looks nice. I'm not sure if I have the right to approve the patch though. Cheers, Filip Kastl