mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-19 09:04:41 +04:00
Implement Store. pre-commit now installs files to ~/.pre-commit
This commit is contained in:
parent
26af2cecab
commit
479eb51873
16 changed files with 457 additions and 234 deletions
21
pre_commit/manifest.py
Normal file
21
pre_commit/manifest.py
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import os.path
|
||||
|
||||
import pre_commit.constants as C
|
||||
from pre_commit.clientlib.validate_manifest import load_manifest
|
||||
from pre_commit.util import cached_property
|
||||
|
||||
|
||||
class Manifest(object):
|
||||
def __init__(self, repo_path_getter):
|
||||
self.repo_path_getter = repo_path_getter
|
||||
|
||||
@cached_property
|
||||
def manifest_contents(self):
|
||||
manifest_path = os.path.join(
|
||||
self.repo_path_getter.repo_path, C.MANIFEST_FILE,
|
||||
)
|
||||
return load_manifest(manifest_path)
|
||||
|
||||
@cached_property
|
||||
def hooks(self):
|
||||
return dict((hook['id'], hook) for hook in self.manifest_contents)
|
||||
Loading…
Add table
Add a link
Reference in a new issue