-
Notifications
You must be signed in to change notification settings - Fork 238
howto pre commit
Ludovico Bianchi edited this page Jul 14, 2022
·
3 revisions
- Pre-commit hooks are scripts that are automatically run by Git "client-side" (i.e. on a developer's local machine) whenever
git commit
is run
- Pre-commit hooks are distinct (and, indeed, complementary) from "server-side" functionality, such as the check suite that is run when a local commit is pushed to the IDAES GitHub remote as part of the IDAES Continuous Integration (CI) workflow:
- Pre-commit hooks run locally, before a commit is pushed
- The IDAES CI check suite runs remotely (on GitHub), after a commit is pushed (typically to the head branch of an open PR)
- IDAES uses the pre-commit framework to manage a few hooks that are useful for IDAES developers. Read below for instructions.
- PR #911 must be merged in (or the files copied manually)
pip install -r requirements-dev.txt
pre-commit install
- Useful to check if they work, etc
pre-commit run
- pre-commit homepage
- In addition to pre-commit hooks, there are other types of Git hooks, corresponding to different phases of the Git workflow: find more detail in the Git hooks section of the Git documentation
- Set up pre-commit
- Run pytest with coverage report
- Run Pylint locally
- Update the Pyomo version
- Install Pyomo from a local Git clone
- Set up GitHub authentication with GCM
- Handle warnings in pytest