-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should TCH run on pyi files? #3357
Comments
My initial reaction is that you’re right. Let me see what the originating plug-in does (though we may want to change it anyway even if they run on pyi files). |
I didn't think flake8 ran on cython files to begin with (or at least, wasn't meant to) |
Sorry, I might be misunderstanding - we’re talking about pyi stub files here, not Cython files, right? |
sorry I'm mixing up things (in pandas I think running it on a directory doesn't pick up the stub files, but indeed, passing them explicitly, the original plugin would flag them (.311venv) marcogorelli@DESKTOP-U8OKFP3:~/pandas-dev$ flake8 pandas/_libs --select=TC001
(.311venv) marcogorelli@DESKTOP-U8OKFP3:~/pandas-dev$ flake8 pandas/_libs/lib.pyi --select=TC001
pandas/_libs/lib.pyi:16:1: TC001 Move application import 'pandas._typing.DtypeObj' into a type-checking block
pandas/_libs/lib.pyi:16:1: TC001 Move application import 'pandas._typing.npt' into a type-checking block
pandas/_libs/lib.pyi:16:1: TC001 Move application import 'pandas._typing.ArrayLike' into a type-checking block |
Ahh ok, got it. Well, I think it makes sense to exclude these rules from the TCH checks, I don't see a benefit in enforcing those rules on stub files. |
I can fix this today. |
using if |
Oh lol yeah, that sounds bad then! |
Hi,
See here: pandas-dev/pandas#51794
The TCH code is reporting lots of errors in typing stub files (
.pyi
) - is this right? They're only used by the type checker anyway, perhapsTCH
shouldn't run for this file type?The text was updated successfully, but these errors were encountered: