yamllint/yamllint
¶
Configures a yamllint job.
Description¶
This component adds a job to a CI/CD pipeline that executes the yamllint syntax checker and writes produces a GitLab Code Quality report.
Usage¶
include:
- component: git.ligo.org/computing/gitlab/components/yamllint/yamllint@<VERSION>
Inputs¶
Input | Default value | Description |
---|---|---|
job_name | "yamllint" | Name to give the job |
stage | "test" | Pipeline stage in which to run the job |
yamllint_options | "" | Options to pass to yamllint |
target | "." | File glob or directory to check |
fail_on_findings | false | If true fail the pipeline if yamllint finds errors (or warnings if --strict is given in yamllint_options ) |
Customisation¶
yamllint
configuration should be given in one of the standard paths as documented in the Configuration docs:
.yamllint
.yamllint.yaml
.yamllint.yml
(all relative to the project root). To use a configuration file with a different path, include the --config-file
option in yamllint_options
pointing at the chosen configuration file.
Examples¶
Scan a project with YAML files¶
Scan a project with YAML files
include:
- component: git.ligo.org/computing/gitlab/components/yamllint/yamllint@<VERSION>
Scan a subproject with a custom configuration file¶
Scan a project with YAML files
include:
- component: git.ligo.org/computing/gitlab/components/yamllint/yamllint@<VERSION>
inputs:
target: "subpackage/"
yamllint_options: "--config-file subpackage/.yamllint.yaml"