MCPcopy Create free account
hub / github.com/docker/docker-py / matches

Method matches

docker/utils/build.py:166–183  ·  view source on GitHub ↗
(self, filepath)

Source from the content-addressed store, hash-verified

164 self.patterns.append(Pattern('!.dockerignore'))
165
166 def matches(self, filepath):
167 matched = False
168 parent_path = os.path.dirname(filepath)
169 parent_path_dirs = split_path(parent_path)
170
171 for pattern in self.patterns:
172 negative = pattern.exclusion
173 match = pattern.match(filepath)
174 if not match and parent_path != '':
175 if len(pattern.dirs) <= len(parent_path_dirs):
176 match = pattern.match(
177 os.path.sep.join(parent_path_dirs[:len(pattern.dirs)])
178 )
179
180 if match:
181 matched = not negative
182
183 return matched
184
185 def walk(self, root):
186 def rec_walk(current_dir):

Callers 1

rec_walkMethod · 0.95

Calls 3

split_pathFunction · 0.85
matchMethod · 0.80
joinMethod · 0.80

Tested by

no test coverage detected