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

yml files contsains whitespace characters after project creation #5570

Closed
Metal-Bat opened this issue Dec 4, 2024 · 2 comments
Closed

yml files contsains whitespace characters after project creation #5570

Metal-Bat opened this issue Dec 4, 2024 · 2 comments
Labels

Comments

@Metal-Bat
Copy link

What happened?

well after project creation we can find lines only with some whitespace characters and it is b.c of if statments

Additional details

places like in local and production docker compose files -> 'redis' service -> before and after of redis volumes
or in production top of the file volumes before and after 'production_redis_data'

  • Host system configuration:

    • Cookiecutter 1.7.3

    • Distributor ID: Debian

    • Description: Debian GNU/Linux 12 (bookworm)

    • Release: 12

    • Codename: bookworm

    • Python 3.11.2

    • Docker version 20.10.24+dfsg1, build 297e128

    • docker-compose version 1.29.2

    • Docker Compose version v2.30.3

solution i offer

  • adding a formmater to project and format the yamls files after project setup
@Metal-Bat Metal-Bat added the bug label Dec 4, 2024
@Metal-Bat
Copy link
Author

also there is a similar problem for html like in
'templates.users.user_detail.html'

in these we have white space

`

{% if cookiecutter.username_type == "email" %}
{% raw %}{{ object.name }}{% endraw %}
{% else %}
{% raw %}{{ object.username }}{% endraw %}
{% endif %}

{% endraw %}
{% if cookiecutter.username_type == "email" %}
{% raw %}{{ object.name }}{% endraw %}
{% else %}
{% raw %}{{ object.username }}{% endraw %}
{% endif %}
`

@browniebroke
Copy link
Member

We don't garantee that auto-fixables pre-commit checks pass (see #4261), we only try to minimise them. Templated cookicutter files are extremely difficult to make compatible with all formatting (for isort, it's not even possible), but it's trivial to fix after generation: just run pre-commit and it format all your files.

Feel free to send a PR to reduce the likelyhood of such failures though.

@browniebroke browniebroke closed this as not planned Won't fix, can't repro, duplicate, stale Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants