Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport json emitter and stdin changes #5054

Commits on Oct 28, 2021

  1. Make --check work when running from stdin. (rust-lang#3896)

    # Conflicts:
    #	src/bin/main.rs
    jugglerchris authored and karyon committed Oct 28, 2021
    Configuration menu
    Copy the full SHA
    80287e1 View commit details
    Browse the repository at this point in the history
  2. Fix --check -l with stdin. (rust-lang#3910)

    * Fix some possible panics when using `--check` with stdin.
    
    One case which doesn't work is when there are only line ending fixes;
    with stdin rustfmt is unable to detect the difference as it stores
    the input with Unix line endings.
    
    * Add test for `rustfmt --check -l` with stdin.
    jugglerchris authored and karyon committed Oct 28, 2021
    Configuration menu
    Copy the full SHA
    5493fa1 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    187c291 View commit details
    Browse the repository at this point in the history
  4. Fix newlines in JSON output (rust-lang#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 rust-lang#4259
    
    * Update tests
    # Conflicts:
    #	tests/writemode/target/output.json
    Timmmm authored and karyon committed Oct 28, 2021
    Configuration menu
    Copy the full SHA
    8d9e542 View commit details
    Browse the repository at this point in the history
  5. Use <stdin> when emitting stdin as filename (rust-lang#4298)

    # Conflicts:
    #	src/config/file_lines.rs
    #	src/rustfmt/main.rs
    #	src/test/mod.rs
    topecongiro authored and karyon committed Oct 28, 2021
    Configuration menu
    Copy the full SHA
    59866b2 View commit details
    Browse the repository at this point in the history