-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Support formatting specified lines. #4020
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.
Thanks! This looks good, just a few pieces of minor feedback.
This has been a long-standing feature request, so it's great to finally see it in Black.
Co-authored-by: Jelle Zijlstra <[email protected]>
for more information, see https://pre-commit.ci
Co-authored-by: Jelle Zijlstra <[email protected]>
Co-authored-by: Jelle Zijlstra <[email protected]>
Co-authored-by: Jelle Zijlstra <[email protected]>
Thanks for the review! Updated. |
Thanks for implementing this @yilei. This will be extremely useful in many situations and circumstances. |
Funnily enough, I was working on the same feature and only now realised it had been finished when trying to open a draft PR. 😛 Oh well, what it's worth, my approach can be found here. |
Also this PR might be enough to close this issue |
@henriholopainen Ah I'm sorry I didn't realize you were working on it. I should have sent the PR earlier as I've had it implemented for a while now. |
This option doesn't appear to be working right for me. I'll post a minimal issue... |
Minimal repro posted here: #4033 |
Description
This adds a command-line option
--line-ranges=
, to tell Black to only format these specified lines.Fixes #830
Checklist - did you ...
CHANGES.md
if necessary?