-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Add diff support to blackd #969
Conversation
src_name = f"In\t{then} +0000" | ||
dst_name = f"Out\t{now} +0000" | ||
loop = asyncio.get_event_loop() | ||
formatted_str = await loop.run_in_executor( |
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 wonder if we can just run black.diff
synchronously here instead of delegating to a process pool.
For short files it's going to be probably faster, but if it takes too long it will block the event loop.
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 I convinced myself that this is probably fine for now, we can be more sophisticated later if it really is too slow
Can you update the docs pls and write an entry in the change log? |
Thanks for the feedback @zsol, will push a revision later today. |
If you hurry this will get to the next beta. |
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.
Marking as request changes so I can filter through the PRs easier.
I can revise this by EOD. Sorry for letting this sit, got busy with some other side-projects recently :). |
Never apologize for voluntary contributions you're making for free in your spare time. We are thankful for any level of commitment you can provide. |
Delayed by pip install issues with |
Should be good to go, added changelog + doc for the new header flag. |
Thanks! ✨ 🍰 ✨ |
In this PR, I support to
blackd
equivalent to--diff
forblack
. This was requested in #691.I added a test. I also e2e tested it: