Skip to content

Commit

Permalink
Remove unnecessary use of itertools.chain
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdewar committed Aug 6, 2024
1 parent 8e1b875 commit b244cbe
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions hooks/post_gen_project.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
import os
from glob import glob
from itertools import chain
from shutil import rmtree

REMOVE_PATHS = chain(
(
"{% if not cookiecutter.use_bsd3_licence %}LICENSE{% endif %}",
"{% if not cookiecutter.add_precommit_workflows %}.github/workflows/pre-commit*.yml{% endif %}",
"{% if not cookiecutter.automerge_bot_prs %}.github/workflows/auto-merge.yml{% endif %}",
"{% if cookiecutter.packaging != 'pip-tools' %}requirements.txt{% endif %}",
"{% if cookiecutter.packaging != 'pip-tools' %}dev-requirements.txt{% endif %}",
"{% if cookiecutter.packaging != 'pip-tools' or not cookiecutter.mkdocs %}doc-requirements.txt{% endif %}",
"{% if not cookiecutter.mkdocs %}docs{% endif %}",
),
glob("README.*.jinja"),
REMOVE_PATHS = (
"{% if not cookiecutter.use_bsd3_licence %}LICENSE{% endif %}",
"{% if not cookiecutter.add_precommit_workflows %}.github/workflows/pre-commit*.yml{% endif %}",
"{% if not cookiecutter.automerge_bot_prs %}.github/workflows/auto-merge.yml{% endif %}",
"{% if cookiecutter.packaging != 'pip-tools' %}requirements.txt{% endif %}",
"{% if cookiecutter.packaging != 'pip-tools' %}dev-requirements.txt{% endif %}",
"{% if cookiecutter.packaging != 'pip-tools' or not cookiecutter.mkdocs %}doc-requirements.txt{% endif %}",
"{% if not cookiecutter.mkdocs %}docs{% endif %}",
"README.*.jinja",
)

for path in REMOVE_PATHS:
Expand Down

0 comments on commit b244cbe

Please sign in to comment.