by devstein on 6/4/24, 5:42 PM with 0 comments
We use MyPy to ensure type-safety across our entire codebase, but we do not have coverage on Jinja template variables.
We want to know if someone either
(a) forgets to pass a required template variable to a Jinja template (b) passes a name of a template variable that doesn't exist
We already get these errors at runtime with Jinja, but want to know if there is a way to statically check for this.
I'm curious if anyone has run into this before or has suggestions for type-safe templating in Python.
Thanks!