rust/src/emitter
Tim 894a3c0e77 Fix newlines in JSON output (#4262)
* Fix newlines in JSON output

This changes the JSON output to be more consistent about where newlines are included. Previously it only included them between lines in a multiline diff. That meant single line changes were treated a bit weirdly. This changes it to append a newline to every line.

When feeding the results into `arc lint` this behaves correctly. I have only done limited testing though, in particular there's a possibility it might not work with files with `\r\n` endings (though that would have been the case before too).

Fixes #4259

* Update tests
# Conflicts:
#	tests/writemode/target/output.json
2022-01-02 10:06:06 -06:00
..
checkstyle Use trait to abstract emit modes (#3616) 2019-06-13 06:59:20 +09:00
checkstyle.rs Make --check work when running from stdin. (#3896) 2022-01-02 10:06:06 -06:00
diff.rs Fix --check -l with stdin. (#3910) 2022-01-02 10:06:06 -06:00
files.rs add new flag to list names of misformatted files (#3747) 2019-08-19 11:04:40 +09:00
files_with_backup.rs add json emit mode (#3735) 2019-08-16 11:14:53 +09:00
json.rs Fix newlines in JSON output (#4262) 2022-01-02 10:06:06 -06:00
modified_lines.rs add json emit mode (#3735) 2019-08-16 11:14:53 +09:00
stdout.rs add json emit mode (#3735) 2019-08-16 11:14:53 +09:00