summaryrefslogtreecommitdiff
path: root/.gitlab/ci/yaml.gitlab-ci.yml
blob: 0420f158bbb15359912e9d8d03f6b6fa37d1a574 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Yamllint of yaml files.

# This uses rules from project root `.yamllint`.
lint-yaml:
  extends:
    - .default-retry
    - .yaml-lint:rules
  image: pipelinecomponents/yamllint:latest
  stage: lint
  needs: []
  script:
    - yamllint --strict -f colored .

# The jobs below will not use the configuration present in `.yamllint` (it's because of the -d option)
#
# Docs: https://yamllint.readthedocs.io/en/stable/configuration.html#custom-configuration-without-a-config-file

lint-pipeline-yaml:
  extends:
    - .default-retry
    - .lint-pipeline-yaml:rules
  image: pipelinecomponents/yamllint:latest
  stage: lint
  needs: []
  variables:
    LINT_PATHS: .gitlab-ci.yml .gitlab/ci lib/gitlab/ci/templates data/deprecations data/removals data/whats_new
  script:
    - 'yamllint -d "{extends: default, rules: {line-length: disable, document-start: disable}}" $LINT_PATHS'

lint-metrics-yaml:
  extends:
    - .default-retry
    - .lint-metrics-yaml:rules
  image: pipelinecomponents/yamllint:latest
  stage: lint
  needs: []
  variables:
    LINT_PATHS: config/metrics
  script:
    - 'yamllint --strict -f colored -d "{extends: default, rules: {line-length: disable, document-start: disable, indentation: {spaces: 2, indent-sequences: whatever}}}" $LINT_PATHS'