File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 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
113113* ` display ` Will print the formatted files to stdout.
114114* ` plain ` Also writes to stdout, but with no metadata.
115115* ` 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.
117116* ` check ` Checks if the program's formatting matches what rustfmt would do. Silently exits
118117 with code 0 if so, emits a diff and exits with code 1 if not. This option is
119118 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.
166165## Checking style on a CI server
167166
168167To 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
170169rustfmt to exit with an error code if the input is not formatted correctly.
171170It will also print any found differences.
172171
@@ -177,7 +176,7 @@ language: rust
177176before_script :
178177- rustup component add rustfmt-preview
179178script :
180- - cargo fmt --all -- --write-mode=diff
179+ - cargo fmt --all -- --write-mode=check
181180- cargo build
182181- cargo test
183182` ` `
You can’t perform that action at this time.
0 commit comments