Open collerek opened 3 years ago
I have experience writing mypy plugins and could do this, could you make a list of things the plugin would need to check for?
@pmdevita Great to hear that! :)
The most crucial things are:
field_name: int = ormar.String()
in reality field_name will have type string despite your type hint. It's more complicated for relations where those are changed with unions (cause you can set relation with Model, dictionary or just primary key value), the field type is set on pydantic model so might be extracted from there
Since a lot of things in
ormar
are generated dynamicallymypy
does not play well with some of them.That's the idea behind custom plugin enhancing how mypy handles ormar, similar to the one used by pydantic.