Add pre-commit hooks
There are currently no pipelines.
To run a merge request pipeline, the jobs in the CI/CD configuration file must be configured to run in merge request pipelines and you must have sufficient permissions in the source project.
Pre-commit hooks are a way of running arbitrary code that checks the contents of each commit. Hooks for each repository are defined in the .pre-commit-config.yaml
file. The current configuration runs Maven's compile phase only. Unit tests, style checking, static analysis and other hooks should be added later.
Documentation is required to set up the hooks. We'll need to discuss where to put this: the readme, contributing guide, manual or something else. See installation guide below:
First install the pre-commit Python package by following the installation instructions.
Then, inside the root of the repository, run:
pre-commit install
After installation of the hooks, they will be triggered at each commit if any Java files have changed. Pre-commit hooks can be run manually as well with:
pre-commit run
To run a merge request pipeline, the jobs in the CI/CD configuration file must be configured to run in merge request pipelines and you must have sufficient permissions in the source project.