cookiecutter is popular way to create projects or modules from templates. Some repositories include cookiecutter templates in subdirectories. The files in those template are often not valid python since they contain jinja2 template tags, e.g. from transformers import {{cookiecutter.camelcase_modelname}}Tokenizer or {% if cookiecutter.has_slow_class == "True" and cookiecutter.has_fast_class == "True" -%}.
One examples is transformers. If we run ruff .¹ on the repo, we get a bunch of errors related to cookiecutter:
It would be better to instead skip all paths that contain {{cookiecutter. Paths that contain {{ are not valid python modules and i don't know of any other usage of {{ in paths.
¹ transformers itself uses ruff examples tests src utils setup.py conftest.py to ignore e.g. templates
For reference Copier is another popular alternative to cookiecutter. It uses .jinja extensions so this will not be an issue. Cookiecutter does not seem to use this unfortunately.
cookiecutter is popular way to create projects or modules from templates. Some repositories include cookiecutter templates in subdirectories. The files in those template are often not valid python since they contain jinja2 template tags, e.g.
from transformers import {{cookiecutter.camelcase_modelname}}Tokenizer
or{% if cookiecutter.has_slow_class == "True" and cookiecutter.has_fast_class == "True" -%}
.One examples is transformers. If we run
ruff .
¹ on the repo, we get a bunch of errors related to cookiecutter:It would be better to instead skip all paths that contain
{{cookiecutter
. Paths that contain{{
are not valid python modules and i don't know of any other usage of{{
in paths.¹ transformers itself uses
ruff examples tests src utils setup.py conftest.py
to ignore e.g. templates