Friday, March 25, 2022
1 change · master
New functionality added to Odoo
This change adds an optional setup that lets contributors run style checks on their own computer before sending code for review. It can reduce failed automated checks, speed up feedback, and help conserve shared validation resources.
Original PR description
Git hooks are shell scripts to execute before/after git actions. One
example is the common `pre-commit` hook, a script that runs just before
creating the new commit. Those scripts are often used to run unittests
or lint the changed files.
Lately a lot of pylint checks have been enable in the runbot, the CI
environment used by Odoo to validate pull requests. In order to free
server resources and to accelerate the feedback to the users, we
introduce opt-in git hook scripts for pylint.
To enable the git hook, execute the following steps :
$ # Use .githooks instead of .git/hooks
$ git config core.hooksPath .githooks
$ # Enable the pylint script
$ cp .githooks/scripts/pylint.sample .githooks/pre-push.d/pylint
Further details are found in the `README.md` file.
Task: 2455766