You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
--check doe not exit with status code 1 if the input file is stdin, despite what --help says.
Honestly, this behavior is preferable for our usecase, as we can already tell if the input is formatted correctly by the presence of the output diff, and can use the status code for more fatal errors.
$ rustfmt --version
rustfmt 1.4.38-stable (fe5b13d 2022-05-18)
$ rustfmt --help
...
--check Run in 'check' mode. Exits with 0 if input is
formatted correctly. Exits with 1 and prints a diff if
formatting is required.
...
$ rustfmt --check < server.rs
Diff in <stdin> at line 12:
impl Drop for Server {
fn drop(&mut self) {
if !thread::panicking() {
- self.handle.take().unwrap().join().unwrap();
+ self.handle.take().unwrap().join().unwrap();
}
}
}
$ echo $?
0
$ rustfmt --check server.rs
Diff in /ssd/aosp-master/external/rust/crates/openssl/openssl/src/ssl/test/server.rs at line 12:
impl Drop for Server {
fn drop(&mut self) {
if !thread::panicking() {
- self.handle.take().unwrap().join().unwrap();
+ self.handle.take().unwrap().join().unwrap();
}
}
}
$ echo $?
1
The text was updated successfully, but these errors were encountered:
--check
doe not exit with status code 1 if the input file is stdin, despite what--help
says.Honestly, this behavior is preferable for our usecase, as we can already tell if the input is formatted correctly by the presence of the output diff, and can use the status code for more fatal errors.
The text was updated successfully, but these errors were encountered: