-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
[BUG] [Formatter] Attribute access after function calls in Jinja gets extra space #704
Comments
Thanks for reporting! You are welcome to do a pr with this, otherwise I will get it in a release next week. |
chained was pretty rough :D |
# [1.32.0](v1.31.1...v1.32.0) (2023-07-19) ### Bug Fixes * **formatter:** fixed formatting on chained function ([7c2756d](7c2756d)), closes [#704](#704) * **linter:** fixed false positive on h026 data-id ([400882a](400882a)), closes [#711](#711) * **linter:** fixed golang false positive on T027 ([232f4bc](232f4bc)), closes [#712](#712) ### Features * **formatter:** added support for jazzband's sorl-thumbnail tags ([86122dc](86122dc)), closes [#714](#714)
🎉 This issue has been resolved in version 1.32.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
I don't have time to get to #720 in the next few days so I will roll back this change until then. |
I did leave in a fix for the extra spaces, even in chained functions, but only the first function will be formatted currently. |
System Info
Issue
When function formatting is enabled the
following template is formated wrongly
breaking the template.
becomes
The simple case of attribute access directly after the function call is easy
enough to fix by adding
\w
to the\d
in the "index" capture group (matching group 5).Here with some comments on the regex added during testing the issue:
But the repeated case requires a bit more work to fix I think.
How To Reproduce
Add the following test cases to
tests/test_jinja/test_parenthesis.py
:The text was updated successfully, but these errors were encountered: