4 ms·
> then fixing the types man I wish my coworkers did this step
by sinfulprogeny 2y ago
> then fixing the types
man I wish my coworkers did this step
- scott_w 2y agoHaving CI hard fail definitely helps. I won’t pretend I’d be so judicious without it.
- camjw 2y agoSorry this is probably a stupid question - how do you make your CI hard fail if you don't have types? This sounds like the missing piece for me, someone who also prefers just to crack on without types and then add them later.
- spacemanspiffii 2y agoYou can add `mypy` to your CI pipeline https://mypy.readthedocs.io/en/stable/running_mypy.html https://mypy.readthedocs.io/en/stable/running_mypy.html. Pyright is an alternative, and there are more.
- scott_w 2y agoI was referring more specifically to fixing the types. It looks like it's possible to enforce type-hinting with config files to mypy (but I've not tried it): https://stackoverflow.com/questions/55944201/python-type-hinting-how-do-i-enforce-that-project-wide https://stackoverflow.com/questions/55944201/python-type-hin...
- jascha_eng 2y agoRun mypy in strict mode and make that check required.
- EasyMark 2y agoCI generally has a pipeline, no? Or even at worse a shell script that you built? Just add the equivalent of “exit()” when mypy (or whatever typing linter you’re using fails), and then the dev gets notified he broke the build for everyone. That’ll get them to fixing and checking their code before it goes in to the main branch. Peer pressure is underestimated these days I think.