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

Linter doesn't catch invalid template test #13458

Open
miketheman opened this issue Apr 20, 2023 · 2 comments
Open

Linter doesn't catch invalid template test #13458

miketheman opened this issue Apr 20, 2023 · 2 comments
Labels
bug 🐛 developer experience Anything that improves the experience for Warehouse devs HTML requires change to HTML files

Comments

@miketheman
Copy link
Member

From #13457

Raised a TemplateError for if foo is None

Why doesn't curlylint catch this?

@miketheman miketheman added requires triaging maintainers need to do initial inspection of issue bug 🐛 developer experience Anything that improves the experience for Warehouse devs labels Apr 20, 2023
@miketheman
Copy link
Member Author

During investigation, I learned that the test here doesn't actually render templates - rather the get_template() method calls the filesystem and loads the file only, doesn't actually render it (we'd need to inject piles of variables for that to happen).

This test will catch a class of errors like missing endif tags (jinja2.exceptions.TemplateSyntaxError), but doesn't perform the testing that would have surfaced an invalid test condition (aka jinja2.exceptions.TemplateRuntimeError)

@miketheman
Copy link
Member Author

I opened thibaudcolas/curlylint#153 to discuss this kind of thing.

@miketheman miketheman removed the requires triaging maintainers need to do initial inspection of issue label Apr 22, 2023
@miketheman miketheman added the HTML requires change to HTML files label Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 developer experience Anything that improves the experience for Warehouse devs HTML requires change to HTML files
Projects
None yet
Development

No branches or pull requests

1 participant