Commit Graph

14 Commits

Author SHA1 Message Date
Seiichi Uchida
34d374ee5d Use <stdin> when emitting stdin as filename (#4298)
# Conflicts:
#	src/config/file_lines.rs
#	src/rustfmt/main.rs
#	src/test/mod.rs
2022-01-02 10:06:06 -06:00
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
Caleb Cartwright
776baf93f8 refactor: update json emitter to better handle errors (#3953) 2022-01-02 10:06:06 -06:00
Chris Emerson
93b7de5b01 Make --check work when running from stdin. (#3896)
# Conflicts:
#	src/bin/main.rs
2022-01-02 10:06:06 -06:00
Caleb Cartwright
9792ff0529 Fix line numbers in checkstyle output (#3694) 2019-08-19 11:11:35 +09:00
Caleb Cartwright
dfd27663dc add json emit mode (#3735) 2019-08-16 11:14:53 +09:00
Nick Cameron
95d6b64829 Replace WriteMode with EmitMode and backup bool 2018-05-21 14:14:09 +12:00
Nick Cameron
4f522794ae Tidy up and pass tests 2018-03-02 15:07:13 +13:00
topecongiro
4af2aa3a9e Create rustfmt_core crate 2018-02-07 22:48:05 +09:00
Nick Cameron
6f30d9e7c9 Reformat tests 2017-06-13 14:42:54 +12:00
Aleksey Kladov
07cf62fc42 simplify tests
* change layout so that test group `foo` has source files in
`test/foo/source` and target files in `test/foo/target`.

* use significant comments to specify write mode instead of threading
  Option<WriteMode>
2016-04-05 02:45:39 +03:00
Aleksey Kladov
ac4532e161 use format_input function in tests 2016-04-03 00:32:24 +03:00
Mark Story
9c275833fc Get checkstyle tests passing.
Fix up the checkstyle test so they pass. There is still an issue with
the content, but I think that is caused by a problem with how diffs are
being calculated presently.
2016-01-20 00:07:01 -05:00
Mark Story
66d4faf53f Start tests for checkstyle.
They don't yet pass, I've clearly misunderstood the existing tests.
2016-01-18 22:44:10 -05:00