Thanks for the reply.

I was actually wondering....  Black does a before-and-after AST comparison for reliability.  Does MonkeyType do anything like that?

And if not, would MonkeyType be less prone to introducing bugs if we run Black first?


On Sat, Jul 30, 2022 at 9:19 AM Frank Harrison <frank@lursight.com> wrote:
Two completely different use-cases.

Black normalises syntax (always run)
MonkeyType adds typing information (one-time run)

… so you can run each in isolation and be ok.

Normally you run black frequently, on each and every commit/save, as it just makes life easier.

Whereas Monkey type is more one-time affair. Run it once and then ensure that typing is valid with mypy in CiCd.

Bear in mind that MonkeyType can make code changes, and that black will then make those changes conform to its coding style, and that’s ok. More than ok.

F.

On Sat, 30 Jul 2022 at 16:58, Dan Stromberg <drsalists@gmail.com> wrote:

Hello folks.

If you have a project you want to eventually run through both Black and MonkeyType, is there any advantage to running Black first?

IOW, is MonkeyType less likely to get confused by Black-formatted code than by inconsistently multiple-humans-formatted code?

Also, I'm hearing that Black does before-and-after AST's to make sure no bugs are introduced.  Does MonkeyType do anything like this?

Thanks.

_______________________________________________
code-quality mailing list -- code-quality@python.org
To unsubscribe send an email to code-quality-leave@python.org
https://mail.python.org/mailman3/lists/code-quality.python.org/
Member address: frank@doublethefish.com
_______________________________________________
code-quality mailing list -- code-quality@python.org
To unsubscribe send an email to code-quality-leave@python.org
https://mail.python.org/mailman3/lists/code-quality.python.org/
Member address: strombrg@gmail.com