-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
ruff doesn't find the same E721 violations as new flake8 does #12290
Comments
I see #9570 special cases numpy, which explains why line 98 above does not trigger the warning. |
Hm I'm not sure why we're not raising a violation there. It looks like a false negative as far as I can tell? Note some more context on false positives for this rule at #4560 |
A different example from https://github.com/RobertLuptonTheGood/eups. The code: return isinstance(self, EupsCmd) and type(self) != EupsCmd triggers E721 in flake8 but not in ruff.
ruff does find 3 places that flake8 doesn't though. |
I'm also seeing cases where |
Can you give a concrete example of this? |
I believe these are fixed by #12300. |
Sorry. That was bad of me. The code in question was https://github.com/lsst/ip_isr/blob/main/python/lsst/ip/isr/calibType.py#L139 elif type(attrSelf) != type(attrOther): flake8 gave:
and ruff said nothing.
|
@timj No worries! It's fixed and released in the latest version ( |
I searched for E721 but couldn't find a previous ticket.
For the file https://github.com/lsst/geom/blob/main/tests/test_coordinates.py flake8 7.1.0 reports this error:
The relevant line is:
ruff 0.5.1 does not report any E721 violation. There is no ruff configuration in this directory when I clone.
I have other examples of inconsistency. In https://github.com/lsst/fgcm flake8 reports:
ruff reports:
where two of the warnings agree but flake8 is reporting one from line 30 of
fgcmConfig.py
which ruff does not report, and ruff reports one fromsharedNumpyMemManager.py
that flake8 does not report.The text was updated successfully, but these errors were encountered: