Skip to content

Code Formatting

Mostafa Jahanifar edited this page Feb 17, 2021 · 4 revisions

We use Black. Please cede formatting control to Black.

 

 

Command Line Usage

 

To format a single file:

 

black file.py

 

To format all .py files in the current directory:

 

black ./

 

 

Editor Plugins

 

https://black.readthedocs.io/en/stable/editor_integration.html

 

 

File Structure

 

  • Docstring at the top

  • Module imports

    • First tiatoolbox import and then external libraries
  • Class definition

  • Function definition

  • Version definition

 

 

 

Clone this wiki locally