about summary refs log tree commit diff
path: root/src/tools
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2023-01-08 19:57:56 -0800
committerGitHub <noreply@github.com>2023-01-08 19:57:56 -0800
commitbb6a88ad5edee0812f61b41a5d41ca794eb3f979 (patch)
tree6071d8773c7c800beef0667f968c67ba6d235910 /src/tools
parent29420a8e7ab5d5aeeacdd8103eed7c8c19be7001 (diff)
parent31b39be9cef4f028b0a1cde5abff2f8acc426bfd (diff)
downloadrust-bb6a88ad5edee0812f61b41a5d41ca794eb3f979.tar.gz
rust-bb6a88ad5edee0812f61b41a5d41ca794eb3f979.zip
Rollup merge of #106602 - GuillaumeGomez:tidy-goml-scripts, r=Mark-Simulacrum
Add goml scripts to tidy checks

r? ``@notriddle``
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/tidy/src/style.rs13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/tools/tidy/src/style.rs b/src/tools/tidy/src/style.rs
index f409a86db26..723a52c4c68 100644
--- a/src/tools/tidy/src/style.rs
+++ b/src/tools/tidy/src/style.rs
@@ -25,6 +25,7 @@ use std::path::Path;
 /// displayed on the console with --example.
 const ERROR_CODE_COLS: usize = 80;
 const COLS: usize = 100;
+const GOML_COLS: usize = 120;
 
 const LINES: usize = 3000;
 
@@ -230,7 +231,8 @@ pub fn check(path: &Path, bad: &mut bool) {
     walk(path, &mut skip, &mut |entry, contents| {
         let file = entry.path();
         let filename = file.file_name().unwrap().to_string_lossy();
-        let extensions = [".rs", ".py", ".js", ".sh", ".c", ".cpp", ".h", ".md", ".css", ".ftl"];
+        let extensions =
+            [".rs", ".py", ".js", ".sh", ".c", ".cpp", ".h", ".md", ".css", ".ftl", ".goml"];
         if extensions.iter().all(|e| !filename.ends_with(e)) || filename.starts_with(".#") {
             return;
         }
@@ -255,8 +257,15 @@ pub fn check(path: &Path, bad: &mut bool) {
 
         let extension = file.extension().unwrap().to_string_lossy();
         let is_error_code = extension == "md" && is_in(file, "src", "error_codes");
+        let is_goml_code = extension == "goml";
 
-        let max_columns = if is_error_code { ERROR_CODE_COLS } else { COLS };
+        let max_columns = if is_error_code {
+            ERROR_CODE_COLS
+        } else if is_goml_code {
+            GOML_COLS
+        } else {
+            COLS
+        };
 
         let can_contain = contents.contains("// ignore-tidy-")
             || contents.contains("# ignore-tidy-")