MCPcopy Create free account
hub / github.com/4paradigm/OpenMLDB / _FilterExcludedFiles

Function _FilterExcludedFiles

steps/cpplint.py:6860–6868  ·  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

6858 return filtered
6859
6860def _FilterExcludedFiles(fnames):
6861 """Filters out files listed in the --exclude command line switch. File paths
6862 in the switch are evaluated relative to the current working directory
6863 """
6864 exclude_paths = [os.path.abspath(f) for f in _excludes]
6865 # because globbing does not work recursively, exclude all subpath of all excluded entries
6866 return [f for f in fnames
6867 if not any(e for e in exclude_paths
6868 if _IsParentOrSame(e, os.path.abspath(f)))]
6869
6870def _IsParentOrSame(parent, child):
6871 """Return true if child is subdirectory of parent.

Callers 1

ParseArgumentsFunction · 0.85

Calls 1

_IsParentOrSameFunction · 0.85

Tested by

no test coverage detected