-
Notifications
You must be signed in to change notification settings - Fork 27
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
Include ruff #200
Include ruff #200
Conversation
Many of the |
After the above fixes we're at Jack: python-flint % ruff check --statistics
21 F401 unused-import Related to the comment above. |
Yes, I think that Is it only the .pyx files or does it also want it in .pxd files? Also we should remove all |
The
I will be busy now potentially until the end of the week. Feel free to merge / ignore this if you want and we can continue work whenever. |
actually, i think I have misunderstood ruff, the above has ONLY checked python files.
This means I must have missed some flag for the cython files and there might be a LOT more work to do. I will have to look into this more after this week |
I was a bit surprised that this didn't involve changing 10,000 or so lines... |
assert (A1 != A2) is False | ||
assert (A1 == B) is False | ||
assert (A1 != B) is True | ||
assert (A1 == None) is False | ||
assert (A1 != None) is True | ||
assert (None == A1) is False | ||
assert (None != A1) is True | ||
assert (A1 is None) is False | ||
assert (A1 is not None) is True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also the case for some of the other changes but the code here is supposed to be testing __eq__
so it does need to be ==
rather than is
. In cases like this we just need a # ruff: ignore
or whatever the flag is.
we should probably just close this, im not sure this PR really helps with anything currently. |
I also ran
on main and got no errors. |
The actual changes here to the code are mostly not needed or not correct so I guess that the ruff configuration would need to be improved to be useful. I think it could be possible to improve that but it requires choosing which ruff rules to use and configuring them. Obviously feel free to close if you don't want to work on it. The cython-lint checks pass now but note that lots of checks are disabled: Lines 42 to 45 in be0e410
We would probably not want to ignore all of those but enabling each one would likely then require making some changes somewhere in the codebase. |
OK -- I'll close this for now and if I feel like refactoring I'll look at removing elements from the ignore list and refactoring for each one potentially. |
Currently
ruff.toml
is the default settings, feel free to suggest changes.The current output of
ruff
statistics is:I will try and fix these one at a time in some commits.