-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Add djade linter for Django templates (Fixes #2372) #2382
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
base: main
Are you sure you want to change the base?
Conversation
6f24eca to
cb91ead
Compare
cb91ead to
892f574
Compare
sarahboyce
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! A couple of minor nitpicks
| rev: 1.6.0 | ||
| hooks: | ||
| - id: djade | ||
| args: [--target-version, "4.2"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| args: [--target-version, "4.2"] | |
| args: [--target-version, "5.2"] |
This should match our Django version
| djangoproject/cache | ||
| djangoproject/static/css/*.map | ||
| djangoproject/static/css/*.css | ||
| .DS_Store |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| .DS_Store |
| {% endfor %} | ||
| {##} | ||
| {% endblock %} | ||
| {# #} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| {# #} |
Empty comment is odd
Summary
This PR adds the
djadelinter to the project's pre-commit configuration and applies formatting fixes to existing Django templates. This ensures consistent code style (e.g., standardizing whitespace in{{ variables }}) across the codebase.Rationale
As discussed in #2372,
djadewas selected over alternatives likedjLintbecausedjadeis actively maintained and specifically targets Django template formatting. This aligns with the project's goal of using stable, long-term tools.Changes
adamchainz/djade-pre-commit(v1.6.0) to.pre-commit-config.yaml..htmltemplates.Verification
pre-commit run djade --all-fileslocally (passed formatting checks).