Skip to content

Instantly share code, notes, and snippets.

@jimathyp
Created August 9, 2022 23:58
Show Gist options
  • Select an option

  • Save jimathyp/8023097cdeed6e36b1abc0e3d71f2e76 to your computer and use it in GitHub Desktop.

Select an option

Save jimathyp/8023097cdeed6e36b1abc0e3d71f2e76 to your computer and use it in GitHub Desktop.
'Black' python formatter usage notes

"Black" - A Python Formatter

Black will format your code. It can do it automatically on save, or when required.

Black is opinionated - this means it has basically one and only one way that the Python code will be formatted. There is almost no configuraiton.

One major opinion it enforces is the use of double quotes in place of single quotes.

This can be a major change to an existing project.

To allow a more gentle rollout of black formatting, there is the option to use single quotes. Use this only for existing projects.

18.6b0 has --skip-string-normalization, or -S for short.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment