Skip to content
This repository has been archived by the owner on Sep 15, 2019. It is now read-only.
/ cblack Public archive
forked from pausan/cblack

Custom Black Code Formatter with 2-space indents

License

Notifications You must be signed in to change notification settings

lawinsider/cblack

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cblack

Custom Black Code Formatter for Python with 2-space indents

Same rules as Black, only with two-space indents.

Installation

cblack can be installed by running pip3 install cblack.

It requires Python 3.6.0+ to run but you can reformat Python 2 code with it as well.

Why

After a long discussion about indentation levels it was decided by the main author that:

Two space indents are not distinct enough to be recommended by the Black coding style.

The whole pourpose of this project is to provide an alternative to black, with the exact same rules and behaviour, but using 2 spaces for indentation instead of 4. All other black options are still supported.

Second reason is that Google YAPF is not able to produce same output as black (mostly because of function arguments indentation), otherwise, if it was possible to do it, I would not have created this project.

How

I'm a busy man. I don't want to spend my time pulling latest changes from black regularly, so I've created a small package that depends on black and overrides a method to reindent using two spaces. Shall black developers break this behaviour I might end up cloning the whole project. But the aim of this project would still be the same.

Similar projects

  • YAPF
  • Autopep8
  • pep8ify
  • pyfmt
  • prettier in node
  • gofmt in go
  • rustfmt in rust

Credits

All the credit is deserved to the people who created black on the first place.

Please visit black website:

About

Custom Black Code Formatter with 2-space indents

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%