-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Templating engines (jinja2, ...) #8249
Comments
How are you invoking mypy? It should normally just pick up Python files. Perhaps a system could be built by which mypy could extract the Python parts of a template file and typecheck them, but that's not going to be easy. |
Thanks for a quick response.
mypy *.py templates/*html
I came here from
Fair enough. I think this issue can be closed then as I won't have time to implement injection of mypy check routines in the jinja engine to check templates. If you don't want to close this issue, just tell me and I'll leave it open. Another thing though is, that mypy *.py then it works and |
mypy isn't going to add native support for jinja2 |
Can't judge (I'm new to mypy). Therefore first of all just question whether I'm missing something.
or a mock-up repro if the source is private. We would appreciate
if you try to simplify your case to a minimal repro.
E.g. any Flask app as Flask uses jinja2 templating engine.
(note how
mypy
didn't output any other error though the other 5 files are*.py
files full of typing errors if checked separately)mypy
shall find out relevant parts in templates and then checks them (e.g.pytype
from Google seems to do that somehow if I'm not mistaken) instead of outputting such a general error which additionally suppresses all other errors in other files 😮mypy 0.761 (release)
Python 3.8.1 (release)
Do you see the same issue after installing mypy from Git master?
didn't check
no flags
the full traceback below.
no traceback, just the output above 😢
The text was updated successfully, but these errors were encountered: