File tree Expand file tree Collapse file tree 1 file changed +6
-15
lines changed
Expand file tree Collapse file tree 1 file changed +6
-15
lines changed Original file line number Diff line number Diff line change @@ -401,24 +401,15 @@ def _is_file_included(
401401 :param enforce_glob: Can set to false to bypass extension check
402402 :return: Boolean indicating whether a file should be included
403403 """
404- return_value = False
405-
406- # if this is matches a glob of files we look at, and it isn't in an
407- # excluded path
408- if _matches_glob_list (path , included_globs ) or not enforce_glob :
409- if not _matches_glob_list (path , excluded_path_strings ) and not any (
410- x in path for x in excluded_path_strings
411- ):
412- return_value = True
413-
414- return return_value
404+ if enforce_glob and not _matches_glob_list (path , included_globs ):
405+ return False
406+ return not _matches_glob_list (path , excluded_path_strings ) and not any (
407+ x in path for x in excluded_path_strings
408+ )
415409
416410
417411def _matches_glob_list (filename , glob_list ):
418- for glob in glob_list :
419- if fnmatch .fnmatch (filename , glob ):
420- return True
421- return False
412+ return any (fnmatch .fnmatch (filename , glob ) for glob in glob_list )
422413
423414
424415def _compare_baseline_results (baseline , results ):
You can’t perform that action at this time.
0 commit comments