-
-
Notifications
You must be signed in to change notification settings - Fork 185
Format Python code with ruff format instead of black #2824
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
Format Python code with ruff format instead of black #2824
Conversation
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.
Personally, I've been using ruff more lately, so I'm not against switching to it over black. But, I consider #2796 a blocker for this pull because of the failing lint check. I don't want every commit/pull to have a failing lint check while we wait on a fix pull to be merged.
I also would like to see opinions from the pygame-ce steering council.
@cclauss I haven't seen you on the pygame community discord server, where a lot of contribution discussions happen. If you'd like to join in those conversations, you can join the server at https://discord.gg/pygame |
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.
OK, this looks good to me.
AFAICT, for our purposes ruff is just black (with a couple of super minor formatting differences) that will run faster because the formatting engine is re-written in a native code language (Rust in this case) rather than pure python.
No good reason not to have our formatter run faster (other than my general grumpy dislike of change.)
|
Please re-run the failing test. |
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.
LGTM!
Do we need more approvals? |
@cclauss Don't think so, I think someone just need to press some magical merge button |
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.
single-line-implicit-string-concatenation (ISC001)
…atenation single-line-implicit-string-concatenation
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.
LGTM, thanks for the PR 🎉
Failing tests are fixed in:
We want all tools run in
pre-commit
to be as fast as possible to enhance contributor productivity.Let's consider formatting Python code with a highly compatible yet much faster formatter than Black.
https://docs.astral.sh/ruff/formatter/#philosophy
From: Known Deviations from Black