I use black for format normal .py
files as well as Jupyter Notebook files (.ipynb
). For notebooks, I want a shorter line-length
.
Is it possible to specify different formatting rules for different file extensions with black?
I use black for format normal .py
files as well as Jupyter Notebook files (.ipynb
). For notebooks, I want a shorter line-length
.
Is it possible to specify different formatting rules for different file extensions with black?
You could create two separate files for
.py
and.ipynb
files and run them separatelySome usefull flags from docs:
So, to format multiple types of files, run something like:
Also you could specify
include
field insidetoml
files. It's in docs too: