MCPcopy Index your code
hub / github.com/bugy/script-server / has_match

Method has_match

src/utils/file_utils.py:290–303  ·  view source on GitHub ↗
(self, absolute_path)

Source from the content-addressed store, hash-verified

288 self.pattern = self._normalize_pattern(pattern, working_dir)
289
290 def has_match(self, absolute_path):
291 if '*' not in self.pattern:
292 if self._contains_child(self.pattern, absolute_path):
293 return True
294 else:
295 if absolute_path.match(self.pattern):
296 return True
297
298 if '**' in self.pattern and self._matches_recursive_blob(absolute_path, self.pattern):
299 return True
300
301 for parent in absolute_path.parents:
302 if parent.match(self.pattern):
303 return True
304
305 @staticmethod
306 def _normalize_pattern(pattern, working_dir):

Callers

nothing calls this directly

Calls 3

_contains_childMethod · 0.95
matchMethod · 0.80

Tested by

no test coverage detected