Skip to content

Commit c2ebb06

Browse files
authored
Update README.md to reflect change in #2539
1 parent 3762d80 commit c2ebb06

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

README.md

+2-3
Original file line numberDiff line numberDiff 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

168167
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
170169
rustfmt to exit with an error code if the input is not formatted correctly.
171170
It will also print any found differences.
172171

@@ -177,7 +176,7 @@ language: rust
177176
before_script:
178177
- rustup component add rustfmt-preview
179178
script:
180-
- cargo fmt --all -- --write-mode=diff
179+
- cargo fmt --all -- --write-mode=check
181180
- cargo build
182181
- cargo test
183182
```

0 commit comments

Comments
 (0)