Closed nkakouros closed 3 months ago
A realistic way to do this is to require every new PR to also annotate the code that it touches.
I will create a branch for it and try to implement type hinting in all of the function params and class variables where possible
The code has a mix of type hints being used and not being used. I propose that type hints are used everywhere to help document the code and discover bugs. Integrating mypy or another type checker should help. For example, the following function:
https://github.com/mal-lang/mal-toolbox/blob/9acd22f77028df556f00abbadf9b39bc516e5848/maltoolbox/language/specification.py#L55
expects a
lang_dict
but the code that uses it passes aLanguageGraph
object (which is the proper thing to do):https://github.com/mal-lang/mal-toolbox/blob/9acd22f77028df556f00abbadf9b39bc516e5848/maltoolbox/attackgraph/attackgraph.py#L143-L146
Using a type checker should have warned about this.