adamchainz / djade

A Django template formatter.
MIT License
268 stars 4 forks source link

Source target-version from pyproject.toml #77

Open christophehenry opened 1 month ago

christophehenry commented 1 month ago

Description

Current usage is djade --target-version 5.1 templates/**/*.html. It would be awesome if djade could be configured in pyproject.toml like so:

[tool.djade]
files = [
    "templates/**/*.html"
]
target_version = "5.1"
adamchainz commented 1 month ago

I won't add configuration for which files to run on. I don't believe it's productive for every tool to rebuild their own custom globbing and recursion logic.

But yes, configuring the target version would be neat. There's an idea in django-upgrade to support parsing the target version from dependencies in pyproject.toml ( https://github.com/adamchainz/django-upgrade/issues/322 ). If we can figure that out, it would be worth adding here.