it will run the following checks whenever you run gitcommit, automatically:
Fig. 12 pre-commit hooks invoked by gitcommit (Failed).
If any of the above checks failed, your gitcommit was not successful.
Please fix any issues reported by the check tools.
Hint
Some of the check tools, i.e., black and isort will modify
the files to be committed in-place. So please run gitstatus
after failure to see which file has been modified by the tools
before you make any further changes.
After fixing all the failures, run gitcommit again and
it should succeed this time:
Fig. 13 pre-commit hooks invoked by gitcommit (Succeeded).
If you want to check the style of your code before gitcommit, you
can do the following:
$pre-commitinstall
$pre-commitrun
Or without installing the pre-commit hooks:
$cdicefall
$pipinstallblack==22.3.0flake8==5.0.4isort==5.10.1
$black--checkyour_changed_file.py
$blackyour_changed_file.py# modify it in-place
$
$flake8your_changed_file.py
$
$isort--checkyour_changed_file.py# modify it in-place
$isortyour_changed_file.py