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

[BUG] [Formatter] [nunjucks] djlint 1.28.0 adds extra parenthesis when a macro is called with multiple arguments #660

Closed
3 tasks done
shaileshaanand opened this issue May 20, 2023 · 2 comments
Labels

Comments

@shaileshaanand
Copy link
Contributor

System Info

  • OS: alpine 3.18 (Docker: python:3.11.3-alpine3.18)
  • Python Version 3.11.3
  • djLint Version 1.28.0
  • template language: nunjucks

Issue

djlint 1.28.0 adds extra parenthesis when a macro is called with multiple arguments
This issue started from v1.28.0

How To Reproduce

Setup:
test.njk

<ul>
    <li>{{ foo(1,2) }}</li>
</ul>

Expected Behavior: (taken from v1.17.2)

djlint --reformat --profile nunjucks ./test.njk
###
Reformatting 1/1 files ━━━━━━━━━━━━00:00    


0 files were updated.

Actual Behavior:

djlint --reformat --profile nunjucks ./test.njk
###
Reformatting 1/1 files ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 00:00    


test.njk

@@ -1,3 +1,3 @@

 <ul>
-    <li>{{ foo(1,2) }}</li>
+    <li>{{ foo((1, 2)) }}</li>
 </ul>

1 file was updated.
@shaileshaanand shaileshaanand added 🦠 bug Something isn't working 🧽 formatter labels May 20, 2023
@shaileshaanand
Copy link
Contributor Author

I ran a git bisect and d446efc seems to have introduced this issue

christopherpickering pushed a commit that referenced this issue May 22, 2023
# [1.29.0](v1.28.0...v1.29.0) (2023-05-22)

### Bug Fixes

* **formatter:** fix cases where ignore was still formatting set and function code ([ab878ea](ab878ea)), closes [#659](#659)
* **formatter:** fix extra parenth being added in a function call ([faba4f4](faba4f4)), closes [#660](#660)
* **linter:** fixed missing positive on a few <img rules ([5f33d08](5f33d08))

### Features

* **formatter:** added option to disable newlines after yaml front matter ([9bf64ac](9bf64ac)), closes [#662](#662)
* **linter:** allow codes to be ignored for remainder of file ([4637a0f](4637a0f)), closes [#655](#655)
@christopherpickering
Copy link
Contributor

🎉 This issue has been resolved in version 1.29.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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