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

jinja-variable-lower-case wrongly detects escaped strings as variables #88

Open
DeadNews opened this issue Mar 18, 2024 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@DeadNews
Copy link

DeadNews commented Mar 18, 2024

Description

The jinja-variable-lower-case rule in j2lint is incorrectly identifies escaped strings as variables.
According to the Jinja2 documentation, these strings should be treated as literal strings, not variables.

Steps to Reproduce

{# test.yml.j2 #}
template: '{{ '{{ ToLower .Value }}' }}'
$ j2lint test.yml.j2
test.yml.j2
├── test.yml.j2:1 All variables should use lower case: '{{ variable }}': ToLower (jinja-variable-lower-case)
└── test.yml.j2:1 All variables should use lower case: '{{ variable }}': Value (jinja-variable-lower-case)

Jinja2 linting finished with 2 error(s) and 0 warning(s)

Context

$ j2lint --version                                               
Jinja2-Linter Version v1.1.0
@gmuloc gmuloc added the enhancement New feature or request label Mar 18, 2024
@gmuloc
Copy link
Collaborator

gmuloc commented Mar 18, 2024

Thanks for opening the issue - same answer as here: #85 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants