From charlesreid1

 
(2 intermediate revisions by the same user not shown)
Line 33: Line 33:
To script the installation of Black and the setup of a vim plugin for Black,
To script the installation of Black and the setup of a vim plugin for Black,


==Alternatives to Black==
==Related Style Tools==


If you aren't happy with Black and you want an alternative, you can use:
[[Flake8]] - a set of Python formatting standards, or rules, that can be applied to Python code. Flake8 is different from Black in that it does not apply any fixes, it simply complains about things that don't follow the standard.


 
[[Autopep8]] - automatically forces code to conform to PEP8 standard.
==Flake8==
 
[[Flake8]] is a set of Python formatting standards, or rules, that can be applied to Python code. Flake8 is different from Black in that it does not apply any fixes, it simply complains about things that don't follow the standard.


==Flags==
==Flags==

Latest revision as of 22:14, 8 August 2019

Black is the uncompromising code formatter: https://black.readthedocs.io/en/stable/

Why Use Black

Lessons learned about gofmt. Also see blog post at https://charlesreid1.github.io/any-color-you-like-as-long-as-its-00add8.html

Installation Instructions

To install black:

Make a vim plugin directory

mkdir -p ~/.vim/plugin

Now copy the black vim plugin into the plugin folder:

cd ~/.vim/plugin && wget https://github.com/psf/black/blob/master/plugin/black.vim

Next start vim up and let black go through the installation/setup process:

vim

Now you should be all set.

Scripting

To script the installation of Black and the setup of a vim plugin for Black,

Related Style Tools

Flake8 - a set of Python formatting standards, or rules, that can be applied to Python code. Flake8 is different from Black in that it does not apply any fixes, it simply complains about things that don't follow the standard.

Autopep8 - automatically forces code to conform to PEP8 standard.

Flags