Skip to content

Commit bdfa97b

Browse files
authored
Rollup merge of rust-lang#146151 - FrancescoV1985:issue-146047-fix, r=Kobzol
fixes auto-run js checks in tidy Modified is_non_auto_or_matches function in src/tools/tidy/src/extra_checks/mod.rs so that .ts extension is considered. Tested locally with `./x.py test tidy --extra-checks=auto:js`
2 parents 7260704 + 858414b commit bdfa97b

File tree

1 file changed

+9
-11
lines changed
  • src/tools/tidy/src/extra_checks

1 file changed

+9
-11
lines changed

src/tools/tidy/src/extra_checks/mod.rs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -720,21 +720,19 @@ impl ExtraCheckArg {
720720
if !self.auto {
721721
return true;
722722
}
723-
let ext = match self.lang {
724-
ExtraCheckLang::Py => ".py",
725-
ExtraCheckLang::Cpp => ".cpp",
726-
ExtraCheckLang::Shell => ".sh",
727-
ExtraCheckLang::Js => ".js",
723+
let exts: &[&str] = match self.lang {
724+
ExtraCheckLang::Py => &[".py"],
725+
ExtraCheckLang::Cpp => &[".cpp"],
726+
ExtraCheckLang::Shell => &[".sh"],
727+
ExtraCheckLang::Js => &[".js", ".ts"],
728728
ExtraCheckLang::Spellcheck => {
729-
for dir in SPELLCHECK_DIRS {
730-
if Path::new(filepath).starts_with(dir) {
731-
return true;
732-
}
729+
if SPELLCHECK_DIRS.iter().any(|dir| Path::new(filepath).starts_with(dir)) {
730+
return true;
733731
}
734-
return false;
732+
&[]
735733
}
736734
};
737-
filepath.ends_with(ext)
735+
exts.iter().any(|ext| filepath.ends_with(ext))
738736
}
739737

740738
fn has_supported_kind(&self) -> bool {

0 commit comments

Comments
 (0)