diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2017-03-31 12:08:31 -0600 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2017-03-31 12:16:03 -0600 |
| commit | 4de4a955052febfbcd28fd156a7585b90b5dd184 (patch) | |
| tree | 8b0a9133d400f5328094bb93238696d45b732ec6 /src/tools | |
| parent | 51d3cec38794beb644f67e80b1e7718ee14facf0 (diff) | |
| download | rust-4de4a955052febfbcd28fd156a7585b90b5dd184.tar.gz rust-4de4a955052febfbcd28fd156a7585b90b5dd184.zip | |
Add end whitespace ignore flag for tidy
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/tidy/src/style.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/tools/tidy/src/style.rs b/src/tools/tidy/src/style.rs index 2233f8c3529..012301299e0 100644 --- a/src/tools/tidy/src/style.rs +++ b/src/tools/tidy/src/style.rs @@ -110,6 +110,7 @@ pub fn check(path: &Path, bad: &mut bool) { let skip_cr = contents.contains("ignore-tidy-cr"); let skip_tab = contents.contains("ignore-tidy-tab"); let skip_length = contents.contains("ignore-tidy-linelength"); + let skip_end_whitespace = contents.contains("ignore-tidy-end-whitespace"); for (i, line) in contents.split("\n").enumerate() { let mut err = |msg: &str| { println!("{}:{}: {}", file.display(), i + 1, msg); @@ -122,7 +123,7 @@ pub fn check(path: &Path, bad: &mut bool) { if line.contains("\t") && !skip_tab { err("tab character"); } - if line.ends_with(" ") || line.ends_with("\t") { + if !skip_end_whitespace && (line.ends_with(" ") || line.ends_with("\t")) { err("trailing whitespace"); } if line.contains("\r") && !skip_cr { |
