MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / relative_walk

Function relative_walk

tests/packagedcode/test_debian_copyright.py:115–126  ·  view source on GitHub ↗

Walk path and yield files paths relative to dir_path.

(dir_path)

Source from the content-addressed store, hash-verified

113
114
115def relative_walk(dir_path):
116 '''
117 Walk path and yield files paths relative to dir_path.
118 '''
119 for base_dir, _dirs, files in walk(dir_path):
120 for file_name in files:
121 if file_name.endswith('.yml'):
122 continue
123 file_path = path.join(base_dir, file_name)
124 file_path = file_path.replace(dir_path, '', 1)
125 file_path = file_path.strip(path.sep)
126 yield file_path
127
128
129def create_test_function(

Callers 1

build_testsFunction · 0.70

Calls 3

walkFunction · 0.85
joinMethod · 0.45
replaceMethod · 0.45

Tested by

no test coverage detected