File tree 1 file changed +2
-3
lines changed
1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -113,7 +113,6 @@ You'll probably want to specify the write mode. Currently, there are modes for
113
113
* ` display ` Will print the formatted files to stdout.
114
114
* ` plain ` Also writes to stdout, but with no metadata.
115
115
* ` diff ` Will print a diff between the original files and formatted files to stdout.
116
- Will also exit with an error code if there are any differences.
117
116
* ` check ` Checks if the program's formatting matches what rustfmt would do. Silently exits
118
117
with code 0 if so, emits a diff and exits with code 1 if not. This option is
119
118
designed to be run in CI-like where a non-zero exit signifies incorrect formatting.
@@ -166,7 +165,7 @@ You can run `rustfmt --help` for more information.
166
165
## Checking style on a CI server
167
166
168
167
To keep your code base consistently formatted, it can be helpful to fail the CI build
169
- when a pull request contains unformatted code. Using ` --write-mode=diff ` instructs
168
+ when a pull request contains unformatted code. Using ` --write-mode=check ` instructs
170
169
rustfmt to exit with an error code if the input is not formatted correctly.
171
170
It will also print any found differences.
172
171
@@ -177,7 +176,7 @@ language: rust
177
176
before_script :
178
177
- rustup component add rustfmt-preview
179
178
script :
180
- - cargo fmt --all -- --write-mode=diff
179
+ - cargo fmt --all -- --write-mode=check
181
180
- cargo build
182
181
- cargo test
183
182
` ` `
You can’t perform that action at this time.
0 commit comments