Skip to content

Conversation

strangiato
Copy link

@strangiato strangiato commented Aug 11, 2022

Reformat all code with black.

Black is a code formater for python that is designed to help keep code styles cleaner. There is no functional change to any code.

It helps to enforce some pep8 best practices and overall helps to keep code consistent.

Black is a great tool to run while you are coding. You can install it with the following:

pip install black

To run black on your code you can use the following command:

black .

You can also setup VSCode to auto apply black for you when you save a file so you never have to run the command.

In the root of your project create the file .vscode/settings.json with the following:

{
    "python.formatting.provider": "black",
    "editor.formatOnSave": true
}

DO NOT add black to your requirements.txt file. This is a dev tool only and should not be added to the built container.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant