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 @@ -333,6 +333,7 @@ pub fn check(path: &Path, bad: &mut bool) {
333
333
. case_insensitive ( true )
334
334
. build ( )
335
335
. unwrap ( ) ;
336
+ let style_file = Path :: new ( file ! ( ) ) ;
336
337
walk ( path, skip, & mut |entry, contents| {
337
338
let file = entry. path ( ) ;
338
339
let filename = file. file_name ( ) . unwrap ( ) . to_string_lossy ( ) ;
@@ -400,7 +401,7 @@ pub fn check(path: &Path, bad: &mut bool) {
400
401
let mut comment_block: Option < ( usize , usize ) > = None ;
401
402
let is_test = file. components ( ) . any ( |c| c. as_os_str ( ) == "tests" )
402
403
|| file. file_stem ( ) . unwrap ( ) == "tests" ;
403
- let is_style = file. ends_with ( file ! ( ) ) ;
404
+ let is_style = file. ends_with ( style_file ) || style_file . ends_with ( file ) ;
404
405
// scanning the whole file for multiple needles at once is more efficient than
405
406
// executing lines times needles separate searches.
406
407
let any_problematic_line = !is_style && !is_test && problematic_regex. is_match ( contents) ;
You can’t perform that action at this time.
0 commit comments