mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Encode the 'local hooks repo' version into the store
This commit is contained in:
parent
927f471a6c
commit
31ccc19ba3
2 changed files with 4 additions and 1 deletions
|
|
@ -17,6 +17,8 @@ YAML_DUMP_KWARGS = {
|
||||||
|
|
||||||
# Bump when installation changes in a backwards / forwards incompatible way
|
# Bump when installation changes in a backwards / forwards incompatible way
|
||||||
INSTALLED_STATE_VERSION = '1'
|
INSTALLED_STATE_VERSION = '1'
|
||||||
|
# Bump when modifying `empty_template`
|
||||||
|
LOCAL_REPO_VERSION = '1'
|
||||||
|
|
||||||
VERSION = pkg_resources.get_distribution('pre-commit').version
|
VERSION = pkg_resources.get_distribution('pre-commit').version
|
||||||
VERSION_PARSED = pkg_resources.parse_version(VERSION)
|
VERSION_PARSED = pkg_resources.parse_version(VERSION)
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import tempfile
|
||||||
|
|
||||||
from cached_property import cached_property
|
from cached_property import cached_property
|
||||||
|
|
||||||
|
import pre_commit.constants as C
|
||||||
from pre_commit.prefixed_command_runner import PrefixedCommandRunner
|
from pre_commit.prefixed_command_runner import PrefixedCommandRunner
|
||||||
from pre_commit.util import clean_path_on_failure
|
from pre_commit.util import clean_path_on_failure
|
||||||
from pre_commit.util import cmd_output
|
from pre_commit.util import cmd_output
|
||||||
|
|
@ -129,7 +130,7 @@ class Store(object):
|
||||||
def make_local_strategy(directory):
|
def make_local_strategy(directory):
|
||||||
copy_tree_to_path(resource_filename('empty_template'), directory)
|
copy_tree_to_path(resource_filename('empty_template'), directory)
|
||||||
return self._new_repo(
|
return self._new_repo(
|
||||||
'local:{}'.format(','.join(sorted(deps))), 'N/A',
|
'local:{}'.format(','.join(sorted(deps))), C.LOCAL_REPO_VERSION,
|
||||||
make_local_strategy,
|
make_local_strategy,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue