From ba8cfd4959c2e4b7a207c6d388771769318374d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?= Date: Fri, 12 Mar 2021 23:29:08 +0100 Subject: [PATCH] feat: Add precommit option and cleanup hook --- copier.yml | 5 +++++ project/scripts/post_generation.py.jinja | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/copier.yml b/copier.yml index ba0ed8c..86e2627 100644 --- a/copier.yml +++ b/copier.yml @@ -122,3 +122,8 @@ python_package_command_line_name: type: str help: Your CLI name if any (for use in the shell) default: "[[ project_name|lower|replace('_', '-')|replace(' ', '-') ]]" + +use_precommit: + type: bool + help: Do you want to use pre-commit? + default: no diff --git a/project/scripts/post_generation.py.jinja b/project/scripts/post_generation.py.jinja index 6f1ff08..3a9416a 100644 --- a/project/scripts/post_generation.py.jinja +++ b/project/scripts/post_generation.py.jinja @@ -29,12 +29,19 @@ def clean_up_providers(): rmdir(".github") +def clean_up_precommit(): + use_precommit = [[ use_precommit ]] + if not use_precommit: + rm(".pre-commit-config.yaml") + + def delete_myself(): rm(__file__) if __name__ == "__main__": clean_up_providers() + clean_up_precommit() delete_myself() print("Project sucessfully generated!")