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
.pyand.ipynbfiles and run them separatelySome usefull flags from docs:
So, to format multiple types of files, run something like:
Also you could specify
includefield insidetomlfiles. It's in docs too: