-
Notifications
You must be signed in to change notification settings - Fork 4
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
Enable linting with ruff #8
Conversation
Thank you. Overall, this looks very good. A few requests:
I am not worried about the order of imports as I don’t see a way to botch something here that wouldn’t immediately fail a test. |
Thanks for taking a look!
I'm not sure I follow your point. If you have some code like
On the empty line between the statements, is the whitespace tab supposed to be at the same indentation as the if block contents or at the same indentation as the outer block? I'll remove the commit that fixes the blank-line-with-whitespace (W293) rule in ruff, which seems to be what this is about.
The issue that ruff is complaining about here is ambiguous-unicode-character-string (RUF001), not general unicode usage. I mostly agree with that, i.e. if there is an ASCII character that's more commonly used, it's mostly just confusing to use other unicode characters (e.g. I'm not even sure how to write the
It was mostly meant to avoid some unused-import (F401) warnings. I'll remove them altogether instead.
I mostly meant the style that that's imposed by ruff here. Going forward it will complain if the imports are not formatted this way (e.g. sorted alphabetically). It's not set in stone though, obviously, so you can tweak it later 😁 |
In your example, you have an extra indentation, which should not happen at all. Also, it’s not within an indented block, but after one. Such indentations can be completely removed. What I was talking about is something like this:
Here, Ruff has removed the indent in the line preceding
That fixed the issue.
Well, I agree for code, where such ambiguities can cause problems. However, we are talking about a docstring here, which is not intended to be parsed as code, so I don’t find the argument convincing.
The last sentence refers to the imports right? In that case, I agree.
Okay. |
This should be fixed in the latest version.
Fair enough, I've removed all those changes. I've also found how to type that typographic apostrophe on my keyboard: on Linux, it works with the Compose key like |
This adds linting with ruff and fixes all the errors that showed up.
The plan is mostly to figure out a configuration that works here and then I'll slowly update the other projects as well.