Code Monkey home page Code Monkey logo

sublime_black's Introduction

sublime_black

Licence Thanks

SublimeText3 package to format python code using black formatter.

Demo

Features

  • Black: Diff to see the changes that would be done to the file.
  • Black: Format to format the file in place using black.

Prerequisites

  • Install black and ensure you can use it in command line to format files.

Setup

Directly from the repository

Clone the git repo into your Packages folder using

git clone https://github.com/csurfer/sublime_black Black

and restart SublimeText3.

Package Control

Submitted to Package Control on May 1st 2018. Should be available soon!

Settings

  • Line length setting for the package is set to 88 by default to be in sync with black. If you intend to change the same Open command palette -> Goto Preferences: Black Settings - User -> 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 same Open command palette -> Goto Preferences: Black Settings - User -> Change "encoding" to the value you desire.
  • String quotes or prefixes are normalized by the default to be in sync with black. This works great for new projects, but may not be the default you want for existing projects. Check out the docs for specific details. If you intend to change the same Open command palette -> Goto Preferences: Black Settings - User -> Change "skip_string_normalization" to either true or false (the default).

Notes

  • 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.

Contributing

Bug Reports and Feature Requests

Please use issue tracker for reporting bugs or feature requests.

Development

Pull requests are most welcome.

Buy the developer a cup of coffee!

If you found the utility helpful you can buy me a cup of coffee using

Donate

sublime_black's People

Contributors

csurfer avatar jefftriplett avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.