summaryrefslogtreecommitdiffstats
path: root/pre_commit/languages/swift.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-27 10:32:18 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-27 10:32:18 +0000
commita75e61fbe483eb1f3bbfb2d61d7c15615f56172b (patch)
tree2200a67ca0cbe0c8091c69a447c70c3b0ca0a79c /pre_commit/languages/swift.py
parentAdding upstream version 3.0.4. (diff)
downloadpre-commit-a75e61fbe483eb1f3bbfb2d61d7c15615f56172b.tar.xz
pre-commit-a75e61fbe483eb1f3bbfb2d61d7c15615f56172b.zip
Adding upstream version 3.1.0.upstream/3.1.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'pre_commit/languages/swift.py')
-rw-r--r--pre_commit/languages/swift.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/pre_commit/languages/swift.py b/pre_commit/languages/swift.py
index c66ad5f..8250ab7 100644
--- a/pre_commit/languages/swift.py
+++ b/pre_commit/languages/swift.py
@@ -5,10 +5,10 @@ import os
from typing import Generator
from typing import Sequence
+from pre_commit import lang_base
from pre_commit.envcontext import envcontext
from pre_commit.envcontext import PatchesT
from pre_commit.envcontext import Var
-from pre_commit.languages import helpers
from pre_commit.prefix import Prefix
from pre_commit.util import cmd_output_b
@@ -16,9 +16,9 @@ BUILD_DIR = '.build'
BUILD_CONFIG = 'release'
ENVIRONMENT_DIR = 'swift_env'
-get_default_version = helpers.basic_get_default_version
-health_check = helpers.basic_health_check
-run_hook = helpers.basic_run_hook
+get_default_version = lang_base.basic_get_default_version
+health_check = lang_base.basic_health_check
+run_hook = lang_base.basic_run_hook
def get_env_patch(venv: str) -> PatchesT: # pragma: win32 no cover
@@ -28,7 +28,7 @@ def get_env_patch(venv: str) -> PatchesT: # pragma: win32 no cover
@contextlib.contextmanager # pragma: win32 no cover
def in_env(prefix: Prefix, version: str) -> Generator[None, None, None]:
- envdir = helpers.environment_dir(prefix, ENVIRONMENT_DIR, version)
+ envdir = lang_base.environment_dir(prefix, ENVIRONMENT_DIR, version)
with envcontext(get_env_patch(envdir)):
yield
@@ -36,9 +36,9 @@ def in_env(prefix: Prefix, version: str) -> Generator[None, None, None]:
def install_environment(
prefix: Prefix, version: str, additional_dependencies: Sequence[str],
) -> None: # pragma: win32 no cover
- helpers.assert_version_default('swift', version)
- helpers.assert_no_additional_deps('swift', additional_dependencies)
- envdir = helpers.environment_dir(prefix, ENVIRONMENT_DIR, version)
+ lang_base.assert_version_default('swift', version)
+ lang_base.assert_no_additional_deps('swift', additional_dependencies)
+ envdir = lang_base.environment_dir(prefix, ENVIRONMENT_DIR, version)
# Build the swift package
os.mkdir(envdir)