From 3a20d52694c9a293d2fbf1aa7cc1c1643b3e30ec Mon Sep 17 00:00:00 2001 From: est31 Date: Sat, 4 Mar 2023 06:55:35 +0100 Subject: [PATCH] Extend the tidy lint to ftl files --- src/tools/tidy/src/style.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/tools/tidy/src/style.rs b/src/tools/tidy/src/style.rs index af6231ed0df..e3f98f42d7d 100644 --- a/src/tools/tidy/src/style.rs +++ b/src/tools/tidy/src/style.rs @@ -430,7 +430,12 @@ pub fn check(path: &Path, bad: &mut bool) { err(DOUBLE_SPACE_AFTER_DOT) } - if line.contains("//") { + if filename.ends_with(".ftl") { + let line_backticks = line.chars().filter(|ch| *ch == '`').count(); + if line_backticks % 2 == 1 { + suppressible_tidy_err!(err, skip_odd_backticks, "odd number of backticks"); + } + } else if line.contains("//") { let (start_line, mut backtick_count) = comment_block.unwrap_or((i + 1, 0)); let line_backticks = line.chars().filter(|ch| *ch == '`').count(); let comment_text = line.split("//").nth(1).unwrap();