Skip to content
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 line range? #142

Closed
laixintao opened this issue Apr 18, 2018 · 5 comments
Closed

Support line range? #142

laixintao opened this issue Apr 18, 2018 · 5 comments

Comments

@laixintao
Copy link

Did black support line range? Like I have huge python file to edit, and just want to format part of the file (in Vim mostly)

In Vim I see No range allowed, so did black support line range? Or just vim-plugin didn't have that feature?

@zsol
Copy link
Collaborator

zsol commented Apr 18, 2018

Black supports # fmt: off and # fmt: on to control where it shouldn't apply any formatting. You should be able to use that to solve your problem

@ambv
Copy link
Collaborator

ambv commented Apr 18, 2018

See #134 for a longer explanation why Black doesn't support partial file reformatting.

@ambv ambv closed this as completed Apr 18, 2018
@laixintao
Copy link
Author

Thanks

@wbolster
Copy link
Contributor

wbolster commented Feb 6, 2019

fyi, i wrote https://github.com/wbolster/black-macchiato

@akaihola
Copy link

Also FYI, I wrote darker with which you can apply Black formatting only to lines which have changed in the Git working tree since the last commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants