Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to silence jinja2 templating warning? #57

Open
paddyroddy opened this issue May 2, 2023 · 0 comments
Open

Is it possible to silence jinja2 templating warning? #57

paddyroddy opened this issue May 2, 2023 · 0 comments

Comments

@paddyroddy
Copy link

I'm working on a cookiecutter template where we have something like this

[project]
classifiers = [
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3 :: Only",
    {%- for python_version in range(
       cookiecutter.min_python_version | replace('3.', '') | int,
       cookiecutter.max_python_version | replace('3.', '') | int + 1
    ) %}
    "Programming Language :: Python :: 3.{{ python_version }}",
    {%- endfor %}
]

[tool.tomlsort]
all = true
spaces_indent_inline_array = 4
trailing_comma_inline_array = true
overrides."project.classifiers".inline_arrays = false

This works fine but toml-sort panics (understandably so). For now, I'm excluding the templated pyproject.toml from the pre-commit hooks at the top level and creating a dummy project inside that and linting in there, i.e. https://github.com/UCL-ARC/python-template/blob/paddys-improvement/.github/workflows/linting.yml. Is there a way for this to work nicely?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant