MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / _FilterExcludedFiles

Function _FilterExcludedFiles

src/tests/coding/cpplint.py:6848–6856  ·  view source on GitHub ↗

Filters out files listed in the --exclude command line switch. File paths in the switch are evaluated relative to the current working directory

(fnames)

Source from the content-addressed store, hash-verified

6846 return filtered
6847
6848def _FilterExcludedFiles(fnames):
6849 """Filters out files listed in the --exclude command line switch. File paths
6850 in the switch are evaluated relative to the current working directory
6851 """
6852 exclude_paths = [os.path.abspath(f) for f in _excludes]
6853 # because globbing does not work recursively, exclude all subpath of all excluded entries
6854 return [f for f in fnames
6855 if not any(e for e in exclude_paths
6856 if _IsParentOrSame(e, os.path.abspath(f)))]
6857
6858def _IsParentOrSame(parent, child):
6859 """Return true if child is subdirectory of parent.

Callers 1

ParseArgumentsFunction · 0.85

Calls 1

_IsParentOrSameFunction · 0.85

Tested by

no test coverage detected