-
Notifications
You must be signed in to change notification settings - Fork 796
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
Update configs to use Ruff format instead of Black #2389
Conversation
max_line_length = 120 # Same as .clang-format | ||
|
||
[*.py] | ||
max_line_length = 88 # Same as Black | ||
max_line_length = 88 # Same as Ruff's default |
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.
If you'd like to have a consistent line-length across all files. I can change it in .clang-format
and/or ruff.toml
to your preference in an follow-up PR.
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.
If you'd like to have a consistent line-length across all files.
God no - that's something I wish these linting tools cared less about :)
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.
Thanks! Could you please arrange for the auto-formatted stuff to land in its own commit then add that commit to https://github.com/mhammond/pywin32/blob/main/.git-blame-ignore-revs
max_line_length = 120 # Same as .clang-format | ||
|
||
[*.py] | ||
max_line_length = 88 # Same as Black | ||
max_line_length = 88 # Same as Ruff's default |
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.
If you'd like to have a consistent line-length across all files.
God no - that's something I wish these linting tools cared less about :)
Done ! Ready to Rebase-merge. |
Follow-up to #2340 (closes #2340 if this is merged first)
Ruff format's style is based on Black's, but with a handful of improvements. It also runs much faster on the entire repo, which is nice locally. There's an added advantage of being mostly Python-version agnostic (at least we don't need to run it in a Python environment, so it won't drop support for older versions faster than we do, unlike Black). Since we already use Ruff's linter, this doesn't add any new tool (and actually removes one) nor configuration file.
First commit are manual changes. Second commit is only running
ruff format