Skip to content

Commit 71ed5e8

Browse files
authored
Fix pre-gen-hooks. (#10)
1 parent 6f20a8d commit 71ed5e8

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

hooks/pre_gen_project.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"""
2222

2323
EXCEPTION_MSG_PYTHONVERSION = """
24-
ERROR: The python version must be >= {PYTHONVERSION_MIN}, got {pythonversion}.
24+
ERROR: The python version must be >= {min_python_version}, got {python_version}.
2525
"""
2626

2727

@@ -30,18 +30,22 @@ def main() -> None:
3030
module_name = "{{ cookiecutter.project_slug}}"
3131

3232
if not re.match(MODULE_REGEX, module_name):
33-
raise ValueError(EXCEPTION_MSG_MODULE_NAME.format(module_name))
33+
raise ValueError(EXCEPTION_MSG_MODULE_NAME.format(module_name=module_name))
3434

3535
environment_name = "{{ cookiecutter.conda_environment_name }}"
3636

3737
if not re.match(ENVIRON_REGEX, environment_name):
38-
raise ValueError(EXCEPTION_MSG_ENVIRON_NAME.format(environment_name))
38+
raise ValueError(
39+
EXCEPTION_MSG_ENVIRON_NAME.format(environment_name=environment_name)
40+
)
3941

4042
python_version = "{{ cookiecutter.python_version }}"
4143

4244
if not re.match(PYTHONVERSION_REGEX, python_version):
4345
raise ValueError(
44-
EXCEPTION_MSG_PYTHONVERSION.format(PYTHONVERSION_MIN, python_version)
46+
EXCEPTION_MSG_PYTHONVERSION.format(
47+
min_python_version=PYTHONVERSION_MIN, python_version=python_version
48+
)
4549
)
4650

4751

0 commit comments

Comments
 (0)