SublimeText3 package to format python code using black formatter.
- Black: Diff to see the changes that would be done to the file.
- Black: Format to format the file in place using black.
- Install black and ensure you can use it in command line to format files.
Clone the git repo into your Packages
folder using
git clone https://github.com/csurfer/sublime_black Black
and restart SublimeText3.
Submitted to Package Control on May 1st 2018. Should be available soon!
- Line length setting for the package is set to 88 by default to be in sync with
black
. If you intend to change the sameOpen command palete -> Goto Preferences: Black Settings - Default -> Change "line_length"
to the value you desire. - Locale setting for the package (required by click's http://click.pocoo.org/5/python3/#python-3-surrogate-handling) by default is set to
en_CA.UTF-8
. If you intend to change the sameOpen command palete -> Goto Preferences: Black Settings - Default -> Change "encoding"
to the value you desire.
- Currently supports only saved file formatting due to conflict between SublimeText3 default python version (3.3) and black supported version (3.6).
- More to come as soon as SublimeText supports latest python version.
Please use issue tracker for reporting bugs or feature requests.
Pull requests are most welcome.
If you found the utility helpful you can buy me a cup of coffee using