about summary refs log tree commit diff
path: root/src/tools
diff options
context:
space:
mode:
authorvarkor <github@varkor.com>2019-04-25 21:54:09 +0100
committervarkor <github@varkor.com>2019-04-25 21:54:09 +0100
commit8c3068784c91a2be86b5ea0e5512290cb0e12481 (patch)
tree5e9967b1846411861abbded4d17d3fa048ac6350 /src/tools
parentb759c2d714d4087fb7465fe880675661d5428117 (diff)
downloadrust-8c3068784c91a2be86b5ea0e5512290cb0e12481.tar.gz
rust-8c3068784c91a2be86b5ea0e5512290cb0e12481.zip
Fix false position on style.rs itself
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/tidy/src/style.rs19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/tools/tidy/src/style.rs b/src/tools/tidy/src/style.rs
index 3bb2643f9c3..599b6c676fb 100644
--- a/src/tools/tidy/src/style.rs
+++ b/src/tools/tidy/src/style.rs
@@ -212,14 +212,17 @@ pub fn check(path: &Path, bad: &mut bool) {
             1 => {}
             n => tidy_error!(bad, "{}: too many trailing newlines ({})", file.display(), n),
         };
-        if !skip_file_length && lines > LINES {
-            tidy_error!(
-                bad,
-                "{}: too many lines ({}) (add `// ignore-tidy-filelength` to the file to \
-                 suppress this error)",
-                file.display(),
-                lines
-            );
+        if lines > LINES {
+            let mut err = |_| {
+                tidy_error!(
+                    bad,
+                    "{}: too many lines ({}) (add `// \
+                     ignore-tidy-filelength` to the file to suppress this error)",
+                    file.display(),
+                    lines
+                );
+            };
+            suppressible_tidy_err!(err, skip_file_length, "");
         }
 
         if let Directive::Ignore(false) = skip_cr {