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] object variable gets turned into repr of object type #756

Closed
3 tasks done
rafales opened this issue Sep 15, 2023 · 4 comments
Closed
3 tasks done
Labels

Comments

@rafales
Copy link

rafales commented Sep 15, 2023

System Info

  • MacOS 13.5.2 (22G91)
  • Python Version: Python 3.11.4
  • djLint Version: 1.32.1
  • template language: e.g. jinja

Issue

Well, I use variable "object" in my templates, similar to what django does ({% for object in object_list %}).

The following:

{{ do_something(object) }}

Gets turned into:

{{ do_something(<class 'object'>) }}
image

How To Reproduce

  1. Use above snippet as template example.
  2. Run djlint --reformat example.html.

Additional info

Config used (pyproject.toml):

[tool.djlint]
profile = "jinja"
indent = 2
ignore = "H021,H006,H013"
@rafales rafales added 🦠 bug Something isn't working 🧽 formatter labels Sep 15, 2023
@welcome
Copy link

welcome bot commented Sep 15, 2023

Thanks for opening your first issue here!

christopherpickering pushed a commit that referenced this issue Sep 18, 2023
# [1.33.0](v1.32.1...v1.33.0) (2023-09-18)

### Bug Fixes

* **formatter:** fixed extra breaks added around html tags inside template tags ([6091ffb](6091ffb)), closes [#742](#742)
* **formatter:** fixed extra indend in script tags ([9d04d51](9d04d51)), closes [#733](#733)
* **formatter:** fixed formatting on functions that used python keywords as the param name ([183a7c0](183a7c0)), closes [#756](#756)
* **h033:** fix rull to not match data-action ([f6881e0](f6881e0))
* **linter:** fixed false positive on DJ018 ([78d81dc](78d81dc)), closes [#755](#755)

### Features

* **formatter:** added support for nunjucks async loop tags ([5a32bb3](5a32bb3))
@christopherpickering
Copy link
Contributor

🎉 This issue has been resolved in version 1.33.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@rafales
Copy link
Author

rafales commented Sep 18, 2023

🎉 🔥 Thank you!

@rob101
Copy link

rob101 commented Nov 6, 2023

This issue still persist if you use the object inside a tag, e.g. {% set my_var = object %}. See #784

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

3 participants