mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Implement default_language_version
This commit is contained in:
parent
579b05e424
commit
d3b5a41830
23 changed files with 150 additions and 103 deletions
|
|
@ -5,6 +5,7 @@ import os.path
|
|||
|
||||
import toml
|
||||
|
||||
import pre_commit.constants as C
|
||||
from pre_commit.envcontext import envcontext
|
||||
from pre_commit.envcontext import Var
|
||||
from pre_commit.languages import helpers
|
||||
|
|
@ -29,7 +30,7 @@ def get_env_patch(target_dir):
|
|||
@contextlib.contextmanager
|
||||
def in_env(prefix):
|
||||
target_dir = prefix.path(
|
||||
helpers.environment_dir(ENVIRONMENT_DIR, 'default'),
|
||||
helpers.environment_dir(ENVIRONMENT_DIR, C.DEFAULT),
|
||||
)
|
||||
with envcontext(get_env_patch(target_dir)):
|
||||
yield
|
||||
|
|
@ -50,7 +51,7 @@ def _add_dependencies(cargo_toml_path, additional_dependencies):
|
|||
def install_environment(prefix, version, additional_dependencies):
|
||||
helpers.assert_version_default('rust', version)
|
||||
directory = prefix.path(
|
||||
helpers.environment_dir(ENVIRONMENT_DIR, 'default'),
|
||||
helpers.environment_dir(ENVIRONMENT_DIR, C.DEFAULT),
|
||||
)
|
||||
|
||||
# There are two cases where we might want to specify more dependencies:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue