bot
                                
                                 bot copied to clipboard
                                
                                    bot copied to clipboard
                            
                            
                            
                        Add a !mypy command
Proposal to add a !mypy command
Works like !eval or !timeit but instead of running the file, run a mypy type check on the file using snekbox and return the stdout results.
Discussions on mypy results and inferrable types are pretty common, and usually means copying the output of mypy to paste with code in a discussion, having a command would encourage reproducible examples (like eval does)
Depends on
- https://github.com/python-discord/snekbox/pull/159
- https://github.com/python-discord/bot/pull/2326
- Add mypyto our snekbox deployment venv
Related: #1880
Related: #1880
Hm, do you think we should just give a way for users to specify a -m? That would allow stuff like mypy and flake8 without adding new commands. It would just need for those modules to be added to snekbox.
!e -m mypy
# code to check with mypy
!e -m flake8
# code to check with flake8
we can continue to default the first block as main.py and append main.py to the end of the arguments
Dedicated commands would make it easier to add special casing to commands, which we may need (e.g. to provide default settings, maybe allow users to change settings, and maybe for formatting the output).
Commands are more "standard" so e.g. they would work with the !help command by default.
Closing as a duplicate of https://github.com/python-discord/bot/issues/1880, since it's still not approved I think it makes sense to keep discussion in once place.