MCPcopy Index your code
hub / github.com/pre-commit/pre-commit / Prefix

Class Prefix

pre_commit/prefix.py:7–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5
6
7class Prefix(NamedTuple):
8 prefix_dir: str
9
10 def path(self, *parts: str) -> str:
11 return os.path.normpath(os.path.join(self.prefix_dir, *parts))
12
13 def exists(self, *parts: str) -> bool:
14 return os.path.exists(self.path(*parts))
15
16 def star(self, end: str) -> tuple[str, ...]:
17 paths = os.listdir(self.prefix_dir)
18 return tuple(path for path in paths if path.endswith(end))

Callers 15

_prefixFunction · 0.90
_cloned_repository_hooksFunction · 0.90
install_environmentFunction · 0.90
test_pathFunction · 0.90
test_path_multiple_argsFunction · 0.90
test_existsFunction · 0.90
test_starFunction · 0.90
test_basic_health_checkFunction · 0.90
test_environment_dirFunction · 0.90
test_no_env_noopFunction · 0.90
test_basic_run_hookFunction · 0.90

Calls

no outgoing calls

Tested by 15

test_pathFunction · 0.72
test_path_multiple_argsFunction · 0.72
test_existsFunction · 0.72
test_starFunction · 0.72
test_basic_health_checkFunction · 0.72
test_environment_dirFunction · 0.72
test_no_env_noopFunction · 0.72
test_basic_run_hookFunction · 0.72
test_manifest_hooksFunction · 0.72
python_dirFunction · 0.72