@@ -215,8 +215,7 @@ def discover_files(self, targets, recursive=False, excluded_paths=""):
215
215
216
216
# if there are command line provided exclusions add them to the list
217
217
if excluded_paths :
218
- for path in excluded_paths .split ("," ):
219
- excluded_path_globs .append (path )
218
+ excluded_path_globs .extend (excluded_paths .split ("," ))
220
219
221
220
# build list of files we will analyze
222
221
for fname in targets :
@@ -401,24 +400,15 @@ def _is_file_included(
401
400
:param enforce_glob: Can set to false to bypass extension check
402
401
:return: Boolean indicating whether a file should be included
403
402
"""
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
403
+ if enforce_glob and not _matches_glob_list (path , included_globs ):
404
+ return False
405
+ if _matches_glob_list (path , excluded_path_strings ):
406
+ return False
407
+ return not any (x in path for x in excluded_path_strings )
415
408
416
409
417
410
def _matches_glob_list (filename , glob_list ):
418
- for glob in glob_list :
419
- if fnmatch .fnmatch (filename , glob ):
420
- return True
421
- return False
411
+ return any (fnmatch .fnmatch (filename , glob ) for glob in glob_list )
422
412
423
413
424
414
def _compare_baseline_results (baseline , results ):
0 commit comments