about summary refs log tree commit diff
path: root/src/tools
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2017-03-31 12:08:31 -0600
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2017-03-31 12:16:03 -0600
commit4de4a955052febfbcd28fd156a7585b90b5dd184 (patch)
tree8b0a9133d400f5328094bb93238696d45b732ec6 /src/tools
parent51d3cec38794beb644f67e80b1e7718ee14facf0 (diff)
downloadrust-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.rs3
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 {