hauntsaninja / mypy_primer

Run mypy and pyright over millions of lines of code
MIT License
55 stars 29 forks source link

"no effect" message confused me #80

Closed CarlFK closed 1 year ago

CarlFK commented 1 year ago

This may be a MyPy CI issue, but I'll start here.

I got this message:

According to mypy_primer, this change has no effect on the checked open source code. robottada

I'm still not sure why or what I should do about it, other than nothing as my PR was accepted.

But when I got it I spent some time trying to figure out what to do.

I suspect this was caused by code being reformatted (by black) but it could have also been me committing the wrong file and leaving the intended change on my local system never to see the light of day.

hauntsaninja commented 1 year ago

Thanks for opening the issue!

For every PR to mypy, we run mypy once with the change and once without the change on a corpus of open source code and diff the results. This lets us find out if we make a change that has unexpected consequences that our unit tests don't catch.

This is the list of real world projects we check https://github.com/hauntsaninja/mypy_primer/blob/master/mypy_primer.py#L1109

I've opened https://github.com/python/mypy/pull/15144 to help clarify the message

hauntsaninja commented 1 year ago

For example, here's a PR that changed mypy's behaviour when checking pandas. There's one new error and one old error that goes away: https://github.com/python/mypy/pull/15045#issuecomment-1506216115