-
Notifications
You must be signed in to change notification settings - Fork 94
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
Dropping black formatter for ruff #2085
base: main
Are you sure you want to change the base?
Conversation
Question -- Is this going to cause issues for people that currently have the |
https://docs.astral.sh/ruff/faq/#how-does-ruffs-formatter-compare-to-black But, certainly, the entire idea here is that users just stop using Part of the impetus here is people complain to me that Thoughts? |
yes! they will fight to a degree. |
|
||
# Setting line-length to 120 (though blacks default is 88) | ||
# Setting line-length to 120 | ||
line-length = 120 |
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.
you sure you don't want to take this opportunity to go to the ruff and black default of 88? 88 is great! https://docs.astral.sh/ruff/settings/#line-length https://stackoverflow.com/a/578318/1279313
otherwise this looks great.
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.
I tried. Even going down to 100 meant I had over 400 files that required manual changes. (Things like docstrings couldn't be automatically reformatted.)
And I do not have time for manually touching >1,000 lines to make them shorter.
(Also, as a personal preference, I might go 100, but 88 feels a bit too narrow when you have a lot of math on the same line.)
Since ppl are fond of VSCode and this will cause problems for folks while we convert to this, John has graciously agreed to delay this PR. So I marked it as draft. There will be an adjustment period, but we will plan to get everything downstream converted. Only folks who work on ARMI will have to battle the conflicting formatters. |
What is the change?
Here I dropped the
black
linter from the project entirely, and switched to usingruff
. This meant I had to:black
frompyproject.toml
and the CIruff
to0.9.7
.ruff
target-version
from Python 3.9 to Python 3.13ruff
(notice this make a TON of small changes for line length).ruff format
to CI.black
and addruff format
.Why is the change being made?
ruff format
is ~30 times faster thanblack
Checklist
doc
folder.pyproject.toml
.