Support formatting specified lines.#4020
Conversation
JelleZijlstra
left a comment
There was a problem hiding this comment.
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 <jelle.zijlstra@gmail.com>
for more information, see https://pre-commit.ci
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
|
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.mdif necessary?