Skip to content

Commit 65fae26

Browse files
Add goml scripts to tidy checks
1 parent d72b7d2 commit 65fae26

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/tools/tidy/src/style.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ use std::path::Path;
2525
/// displayed on the console with --example.
2626
const ERROR_CODE_COLS: usize = 80;
2727
const COLS: usize = 100;
28+
const GOML_COLS: usize = 120;
2829

2930
const LINES: usize = 3000;
3031

@@ -230,7 +231,8 @@ pub fn check(path: &Path, bad: &mut bool) {
230231
walk(path, &mut skip, &mut |entry, contents| {
231232
let file = entry.path();
232233
let filename = file.file_name().unwrap().to_string_lossy();
233-
let extensions = [".rs", ".py", ".js", ".sh", ".c", ".cpp", ".h", ".md", ".css", ".ftl"];
234+
let extensions =
235+
[".rs", ".py", ".js", ".sh", ".c", ".cpp", ".h", ".md", ".css", ".ftl", ".goml"];
234236
if extensions.iter().all(|e| !filename.ends_with(e)) || filename.starts_with(".#") {
235237
return;
236238
}
@@ -255,8 +257,15 @@ pub fn check(path: &Path, bad: &mut bool) {
255257

256258
let extension = file.extension().unwrap().to_string_lossy();
257259
let is_error_code = extension == "md" && is_in(file, "src", "error_codes");
260+
let is_goml_code = extension == "goml";
258261

259-
let max_columns = if is_error_code { ERROR_CODE_COLS } else { COLS };
262+
let max_columns = if is_error_code {
263+
ERROR_CODE_COLS
264+
} else if is_goml_code {
265+
GOML_COLS
266+
} else {
267+
COLS
268+
};
260269

261270
let can_contain = contents.contains("// ignore-tidy-")
262271
|| contents.contains("# ignore-tidy-")

0 commit comments

Comments
 (0)