File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -402,9 +402,10 @@ pub fn check(path: &Path, bad: &mut bool) {
402402 let is_test = file. components ( ) . any ( |c| c. as_os_str ( ) == "tests" )
403403 || file. file_stem ( ) . unwrap ( ) == "tests" ;
404404 let is_style = file. ends_with ( style_file) || style_file. ends_with ( file) ;
405+ let is_style_test = is_test && file. parent ( ) . unwrap ( ) . ends_with ( style_file. with_extension ( "" ) ) ;
405406 // scanning the whole file for multiple needles at once is more efficient than
406407 // executing lines times needles separate searches.
407- let any_problematic_line = !is_style && !is_test && problematic_regex. is_match ( contents) ;
408+ let any_problematic_line = !is_style && !is_style_test && problematic_regex. is_match ( contents) ;
408409 for ( i, line) in contents. split ( '\n' ) . enumerate ( ) {
409410 if line. is_empty ( ) {
410411 if i == 0 {
You can’t perform that action at this time.
0 commit comments