-
Notifications
You must be signed in to change notification settings - Fork 280
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
STY: migrate formatting from black to ruff-format #4868
Conversation
just a note on performance since it's the main selling point for ruff: |
@yt-fido test this please |
1 similar comment
@yt-fido test this please |
bc7f15b
to
4241c11
Compare
@matthewturk @cphyc @chrishavlin anyone up for reviewing this ? |
.git-blame-ignore-revs
Outdated
@@ -47,3 +47,6 @@ ec8bb45ea1603f3862041fa9e8ec274afd9bbbfd | |||
|
|||
# auto upgrade typing idioms from Python 3.8 to 3.9 | |||
4cfd370a8445abd4620e3853c2c047ee3d649fd7 | |||
|
|||
# migration: black -> ruff-format | |||
61ca693b2c58eefc0ca5768ee4c3a8512b47504a |
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 think this isn't the right commit. It should be
61ca693b2c58eefc0ca5768ee4c3a8512b47504a | |
ce25254257185d53e7b3cacf39c48c35424cb753 |
should't it?
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.
Indeed. Thanks for checking !
hooks: | ||
- id: black-jupyter | ||
|
||
- repo: /~https://github.com/adamchainz/blacken-docs |
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.
Sorry if I missed this information - but is ruff also running on docs? I couldn't find the confirmation online. The closest I got was astral-sh/ruff#8237, but then I don't see where ruff is configured to run on the doc?
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.
hum. I may have tricked myself into believing that it was supported when I misunderstood something and didn't link the source in #4748 (comment)
I think the source of my confusion was astropy/astropy#16132, which doesn't have anything to do with embedded python blocks.
I'll revert this and keep blacken-docs around for a little longer, but I'll also link the ruff issue. Thanks !
f685f94
to
d25b38b
Compare
pyproject.toml
Outdated
| yt/frontends/stream/sample_data | ||
)/ | ||
| yt/visualization/_colormap_data.py | ||
''' |
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.
Can we remove the black-specific configuration from pyproject.toml
since it is still in use by blacken-docs?
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.
Good point. I (mostly) reverted it, but I took the opportunity to clean up unnecessary parameters.
d25b38b
to
1ca440d
Compare
1ca440d
to
9394c8e
Compare
I'm just going to merge now before pre-commit.ci auto PR create a merge conflict with this one. Thanks ! |
PR Summary
Closes #4748
The formatting commit is "semi-automated" because ruff was, in some places, somewhat akwardly moving around some strings formatted with
%
, but I found manually changing them to fstrings helped.