It take care of code formating of our notebook. When black jupyter is applied on our notebook some changes is done in our notebook. For example var=1
would be converted to var = 1
.
Pre-commit is like security check at airport. When we commit something it will open our notebooks/files and check with some configurations. In our case it will apply black on that and change the notebook. Hence, pre-commit will takecare of our code formatting.
As mentioned in this instrcutions, do following steps
Run following command in pyprobml
directory.
pip install pre-commit
pre-commit install
This will activate your security guard (pre-commit) to check black formatting on your notebooks.
NOTE: Whenever you commit something, if pre-commit change the notebook then again you need to stage changes and then do commit again.