Skip to content

Commit bda78f8

Browse files
committed
wrote clearer phrasing for config::options::WriteMode::Check
1 parent b0ece6b commit bda78f8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ You'll probably want to specify the write mode. Currently, there are modes for
106106
* `plain` Also writes to stdout, but with no metadata.
107107
* `diff` Will print a diff between the original files and formatted files to stdout.
108108
Will also exit with an error code if there are any differences.
109-
* `check` Similar to `diff`, but is intended to be run in during CI and returns error code 1
110-
on failure instead of 4 as `diff` does.
109+
* `check` Checks if a diff can be generated. If so, rustfmt outputs a diff and quits with exit code 1.
110+
This option is designed to be run in CI-like where a non-zero exit signifies non-standard code formatting.
111111
* `checkstyle` Will output the lines that need to be corrected as a checkstyle XML file,
112112
that can be used by tools like Jenkins.
113113

src/config/options.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ configuration_option_enum! { WriteMode:
183183
Checkstyle,
184184
// Output the changed lines (for internal value only)
185185
Modified,
186-
// Displays how much of the input was processed, but if anything was modified, rustfmt quits
187-
// with exit code 0. This option is intended to be run as part of a CI pipeline.
186+
// Checks if a diff can be generated. If so, rustfmt outputs a diff and quits with exit code 1.
187+
// This option is designed to be run in CI where a non-zero exit signifies non-standard code formatting.
188188
Check,
189189
}
190190

0 commit comments

Comments
 (0)