Skip to content

Pre commit scripts

Ian Hellen edited this page Dec 1, 2022 · 5 revisions

Avoid a bunch of build-time errors by running pre-commit before commiting.

For more info, see the https://pre-commit.com/ documentation

You need to install pre-commit

pip install pre-commit

Then run pre-commit install in the repo

pre-commit install

Every commit will now run the pre-commit checks. In some cases (black and isort) the re-formatted files will be written back to your changes, so you just need to re-add the updated files. In other cases you'll get a report of linting errors that you need to fix.

One pre-commit task that should generate an updated requirements-all.txt doesn't seem to do that so you'll need to add any packages from requirements or setup.py to requirements-all.txt.

View current msticpy pre-commit tasks yaml