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

Function clean

pre_commit/commands/clean.py:10–16  ·  view source on GitHub ↗
(store: Store)

Source from the content-addressed store, hash-verified

8
9
10def clean(store: Store) -> int:
11 legacy_path = os.path.expanduser('~/.pre-commit')
12 for directory in (store.directory, legacy_path):
13 if os.path.exists(directory):
14 rmtree(directory)
15 output.write_line(f'Cleaned {directory}.')
16 return 0

Callers 3

mainFunction · 0.90
test_cleanFunction · 0.90
test_clean_idempotentFunction · 0.90

Calls 2

rmtreeFunction · 0.90
existsMethod · 0.80

Tested by 2

test_cleanFunction · 0.72
test_clean_idempotentFunction · 0.72