diff options
Diffstat (limited to 'src/tools/tidy/src/style.rs')
-rw-r--r-- | src/tools/tidy/src/style.rs | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/tools/tidy/src/style.rs b/src/tools/tidy/src/style.rs index 3cf44a2d7..dee58ff2f 100644 --- a/src/tools/tidy/src/style.rs +++ b/src/tools/tidy/src/style.rs @@ -125,16 +125,13 @@ fn should_ignore(line: &str) -> bool { /// Returns `true` if `line` is allowed to be longer than the normal limit. fn long_line_is_ok(extension: &str, is_error_code: bool, max_columns: usize, line: &str) -> bool { - if extension != "md" || is_error_code { - if line_is_url(is_error_code, max_columns, line) || should_ignore(line) { - return true; - } - } else if extension == "md" { + match extension { + // fluent files are allowed to be any length + "ftl" => true, // non-error code markdown is allowed to be any length - return true; + "md" if !is_error_code => true, + _ => line_is_url(is_error_code, max_columns, line) || should_ignore(line), } - - false } enum Directive { @@ -230,7 +227,7 @@ pub fn check(path: &Path, bad: &mut bool) { super::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"]; + let extensions = [".rs", ".py", ".js", ".sh", ".c", ".cpp", ".h", ".md", ".css", ".ftl"]; if extensions.iter().all(|e| !filename.ends_with(e)) || filename.starts_with(".#") { return; } |