-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Open
Labels
C: apiOne day Black will have an API ...One day Black will have an API ...T: enhancementNew feature or requestNew feature or request
Description
With previous versions, it was possible to just use black.format_str(string) or black.format_str(string, line_length=82).
Now one needs to do:
black.format_str(string, mode=black.FileMode(line_length=82))
It's not a big deal in a module, but format_str was also useful in notebooks to display examples of Python code programmatically generated (for example by astunparse.unparse(tree)).
Therefore, it could be nice to support also black.format_str(string) and black.format_str(string, line_length=82).
The line_length argument is useful when one wants to get code adapted for a presentation (made with Jupyter for example).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C: apiOne day Black will have an API ...One day Black will have an API ...T: enhancementNew feature or requestNew feature or request