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

Function is_our_script

pre_commit/commands/install_uninstall.py:56–61  ·  view source on GitHub ↗
(filename: str)

Source from the content-addressed store, hash-verified

54
55
56def is_our_script(filename: str) -> bool:
57 if not os.path.exists(filename): # pragma: win32 no cover (symlink)
58 return False
59 with open(filename, 'rb') as f:
60 contents = f.read()
61 return any(h in contents for h in (CURRENT_HASH,) + PRIOR_HASHES)
62
63
64def _install_hook_script(

Callers 5

test_is_not_scriptFunction · 0.90
test_is_scriptFunction · 0.90
_install_hook_scriptFunction · 0.85
_uninstall_hook_scriptFunction · 0.85

Calls 1

existsMethod · 0.80

Tested by 3

test_is_not_scriptFunction · 0.72
test_is_scriptFunction · 0.72