mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-20 01:24:42 +04:00
commit
862426576f
7 changed files with 35 additions and 19 deletions
|
|
@ -12,7 +12,11 @@ from pre_commit.languages import system
|
||||||
# # Use None for no environment
|
# # Use None for no environment
|
||||||
# ENVIRONMENT_DIR = 'foo_env'
|
# ENVIRONMENT_DIR = 'foo_env'
|
||||||
#
|
#
|
||||||
# def install_environment(repo_cmd_runner, version='default'):
|
# def install_environment(
|
||||||
|
# repo_cmd_runner,
|
||||||
|
# version='default',
|
||||||
|
# additional_dependencies=None,
|
||||||
|
# ):
|
||||||
# """Installs a repository in the given repository. Note that the current
|
# """Installs a repository in the given repository. Note that the current
|
||||||
# working directory will already be inside the repository.
|
# working directory will already be inside the repository.
|
||||||
#
|
#
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,11 @@ def in_env(repo_cmd_runner, language_version):
|
||||||
yield NodeEnv(repo_cmd_runner, language_version)
|
yield NodeEnv(repo_cmd_runner, language_version)
|
||||||
|
|
||||||
|
|
||||||
def install_environment(repo_cmd_runner,
|
def install_environment(
|
||||||
version='default',
|
repo_cmd_runner,
|
||||||
additional_dependencies=None):
|
version='default',
|
||||||
|
additional_dependencies=None,
|
||||||
|
):
|
||||||
assert repo_cmd_runner.exists('package.json')
|
assert repo_cmd_runner.exists('package.json')
|
||||||
directory = helpers.environment_dir(ENVIRONMENT_DIR, version)
|
directory = helpers.environment_dir(ENVIRONMENT_DIR, version)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,11 @@ from pre_commit.util import shell_escape
|
||||||
ENVIRONMENT_DIR = None
|
ENVIRONMENT_DIR = None
|
||||||
|
|
||||||
|
|
||||||
def install_environment(repo_cmd_runner,
|
def install_environment(
|
||||||
version='default',
|
repo_cmd_runner,
|
||||||
additional_dependencies=None):
|
version='default',
|
||||||
|
additional_dependencies=None,
|
||||||
|
):
|
||||||
"""Installation for pcre type is a noop."""
|
"""Installation for pcre type is a noop."""
|
||||||
raise AssertionError('Cannot install pcre repo.')
|
raise AssertionError('Cannot install pcre repo.')
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,9 +43,11 @@ def norm_version(version):
|
||||||
return version
|
return version
|
||||||
|
|
||||||
|
|
||||||
def install_environment(repo_cmd_runner,
|
def install_environment(
|
||||||
version='default',
|
repo_cmd_runner,
|
||||||
additional_dependencies=None):
|
version='default',
|
||||||
|
additional_dependencies=None,
|
||||||
|
):
|
||||||
assert repo_cmd_runner.exists('setup.py')
|
assert repo_cmd_runner.exists('setup.py')
|
||||||
directory = helpers.environment_dir(ENVIRONMENT_DIR, version)
|
directory = helpers.environment_dir(ENVIRONMENT_DIR, version)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -79,9 +79,11 @@ def _install_ruby(environment, version):
|
||||||
environment.run('rbenv install {0}'.format(version))
|
environment.run('rbenv install {0}'.format(version))
|
||||||
|
|
||||||
|
|
||||||
def install_environment(repo_cmd_runner,
|
def install_environment(
|
||||||
version='default',
|
repo_cmd_runner,
|
||||||
additional_dependencies=None):
|
version='default',
|
||||||
|
additional_dependencies=None,
|
||||||
|
):
|
||||||
directory = helpers.environment_dir(ENVIRONMENT_DIR, version)
|
directory = helpers.environment_dir(ENVIRONMENT_DIR, version)
|
||||||
with clean_path_on_failure(repo_cmd_runner.path(directory)):
|
with clean_path_on_failure(repo_cmd_runner.path(directory)):
|
||||||
# TODO: this currently will fail if there's no version specified and
|
# TODO: this currently will fail if there's no version specified and
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,11 @@ from pre_commit.languages.helpers import file_args_to_stdin
|
||||||
ENVIRONMENT_DIR = None
|
ENVIRONMENT_DIR = None
|
||||||
|
|
||||||
|
|
||||||
def install_environment(repo_cmd_runner,
|
def install_environment(
|
||||||
version='default',
|
repo_cmd_runner,
|
||||||
additional_dependencies=None):
|
version='default',
|
||||||
|
additional_dependencies=None,
|
||||||
|
):
|
||||||
"""Installation for script type is a noop."""
|
"""Installation for script type is a noop."""
|
||||||
raise AssertionError('Cannot install script repo.')
|
raise AssertionError('Cannot install script repo.')
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,11 @@ from pre_commit.languages.helpers import file_args_to_stdin
|
||||||
ENVIRONMENT_DIR = None
|
ENVIRONMENT_DIR = None
|
||||||
|
|
||||||
|
|
||||||
def install_environment(repo_cmd_runner,
|
def install_environment(
|
||||||
version='default',
|
repo_cmd_runner,
|
||||||
additional_dependencies=None):
|
version='default',
|
||||||
|
additional_dependencies=None,
|
||||||
|
):
|
||||||
"""Installation for system type is a noop."""
|
"""Installation for system type is a noop."""
|
||||||
raise AssertionError('Cannot install system repo.')
|
raise AssertionError('Cannot install system repo.')
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue