Each new commit will trigger the pre-commit integration on the developers workstation and inside the pipeline. Meaning you run the same hooks before a commit and inside a pipeline.
See a list of available hooks.
Usage
- Follow the local install guide
- Create GitLab pipeline file
.gitlab-ci.yml:
include:
- component: $CI_SERVER_FQDN/xrow-public/ci-tools/common@stable
- component: $CI_SERVER_FQDN/xrow-public/ci-tools/pre-commit@stable
Run stand alone before the commit.
pre-commit run --all-files
Inputs
| Name | Description | Default | Type |
| --- | --- | --- | --- |
| config-file | Path to the pre-commit configuration file | .pre-commit-config.yaml | string |
| needs | The jobs that this job depends on. | [] | array |
| opts | Extra opts to pass to pre-commit such as --all-files | --all-files | string |
| rules | The jobs that this job depends on. | [{"if":"$CI_PIPELINE_SOURCE == \"schedule\"","when":"never"},{"when":"on_success"}] | array |
| stage | The stage to run the job in | .pre | string |
| tags | The runners that this job depends on. | [] | array |