-
-
Notifications
You must be signed in to change notification settings - Fork 11.2k
MAINT: Use double quotes (ruff rule Q
) (only on .pyi
files)
#29548
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
Conversation
Q
)
I prefer to play loose and free with either single- or double- quotes, but will play along if that is the community decision. It seems a bit disruptive to reformat everything though. |
I'm all for enforcing this, but I can imagine that this 348 file diff could cause merge conflicts in many of the open PR's. So maybe we can limit this to e.g. |
38cb785
to
6a14adc
Compare
Q
)Q
) (only on .pyi
files)
Sure, point taken, thanks - I've updated so it only applies to the |
Out of curiosity; any particular reason for that? |
Double quotes are harder to type (two key presses) and somehow visually heavier and less appealing. So I usually use single quotes when it is a single word or character and double quotes when I truly want to make a statement. |
Yea I guess that makes sense. I'm also fine with using But note that the |
I have a slight preference for single quotes, but have been trying to move to double quotes because of Black. That said, it is easy enough to run ruff to fix things up. |
Yes, every project I contribute to has some expectation that you'll run In other projects I just type single quotes (as @mattip observed, they're easier to type) and then let the auto-formatter sort them out according to the project's preferences I'd appreciate it if this rule could at least be enabled for the stubs anyway, so that quotes can be consistent and neither reviewers nor contributors need think about them 🙏 |
Seems like we can just put this in? FWIW, would be nice to add the ruff rule, but not usre how easy it is just for the stubs. |
Thanks!
That's what this PR does, it enables the rule just for the stubs 😄 Check the changes to |
And in it goes; thanks Marco :) |
Hah sorrysomehow I looked and missed the toml changes... |
Double-quotes came up in a review: #29531 (comment)
If it's a preferred style, then I'd suggest it be automated
The only manual change I did here was to add
Q
toruff.toml
, everything else was justspin lint --fix