From b55574f6f19bdae1027309c51ae29d6f0a70b6fd Mon Sep 17 00:00:00 2001 From: Florian Wilhelm Date: Sat, 10 Aug 2024 21:32:12 +0200 Subject: [PATCH] Fix cookiecutter post_gen_project.py --- .pre-commit-config.yaml | 16 ++++++++++++++++ hooks/post_gen_project.py | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..dd15b37 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,16 @@ +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.6.0 + hooks: + - id: trailing-whitespace + - id: check-added-large-files + - id: check-ast + - id: check-json + - id: check-merge-conflict + - id: check-xml + - id: check-yaml + args: ['--unsafe'] # needed for !! tags in mkdocs.yml + - id: debug-statements + - id: end-of-file-fixer + - id: mixed-line-ending + args: ['--fix=auto'] # replace 'auto' with 'lf' to enforce Linux/Mac line endings or 'crlf' for Windows diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index ba8b457..2cb1907 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -4,7 +4,7 @@ subprocess.call(['git', 'init']) subprocess.call(['git', 'add', '*']) subprocess.call(['git', 'commit', '-m', 'Initial commit']) - subprocess.call(['git', 'remote', 'add', 'origin', '{{ project_repo }}']) + subprocess.call(['git', 'remote', 'add', 'origin', '{{ cookiecutter.project_repo }}']) except Exception as e: print(f"An error occurred during initializing the git repo: {e}") print("Makre sure to manually set up a git repository which is necessary for `hatch-vcs`")