Browse Source

Added treasuremap yaml lint gate

Change-Id: I1cc6a10b4ed235b952b1d411213f3f1543d6c932
changes/06/693906/26
Blake Dittmer 8 months ago
parent
commit
56b8fb4df7
5 changed files with 36 additions and 10 deletions
  1. +2
    -3
      .zuul.yaml
  2. +1
    -2
      tools/gate/install-yaml-lint.sh
  3. +1
    -2
      tools/gate/lintyaml.sh
  4. +7
    -3
      tools/gate/playbooks/lint-yaml.yaml
  5. +25
    -0
      tools/gate/playbooks/yamllint-config.yaml

+ 2
- 3
.zuul.yaml View File

@@ -62,6 +62,7 @@
irrelevant-files:
- ^.*\.rst$
- ^doc/.*$

- job:
name: treasuremap-yaml-lint
nodeset: treasuremap-single-node
@@ -69,9 +70,7 @@
run: tools/gate/playbooks/lint-yaml.yaml
voting: true
irrelevant-files:
- ^.*\.rst$
- ^doc/.*$

- ^py/.*$

- job:
name: treasuremap-seaworthy-site-lint


+ 1
- 2
tools/gate/install-yaml-lint.sh View File

@@ -1,5 +1,4 @@
#!/bin/bash
set -xe
sudo apt-get update
sudo apt-get install --no-install-recommends -y yamllint
sudo apt-get install --no-install-recommends -y yamllint

+ 1
- 2
tools/gate/lintyaml.sh View File

@@ -1,2 +1 @@
#!/bin/bash
yamllint .
yamllint -c ./tools/gate/playbooks/yamllint-config.yaml .

+ 7
- 3
tools/gate/playbooks/lint-yaml.yaml View File

@@ -16,6 +16,10 @@
tasks:
- name: lint-yaml
shell: |
set -xe;
./tools/gate/installyamllint.sh
./tools/gate/lintyaml.sh
set -xe
./tools/gate/install-yaml-lint.sh
./tools/gate/lintyaml.sh
args:
chdir: "{{ zuul.project.src_dir }}"
become: yes


+ 25
- 0
tools/gate/playbooks/yamllint-config.yaml View File

@@ -0,0 +1,25 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
extends: default

rules:
line-length:
max: 80
level: warning
indentation:
level: warning
colons: {max-spaces-after: 1000}
braces: {max-spaces-inside: 5000, level: warning}
empty-lines: {max: 5000, level: warning}
trailing-spaces: disable
new-line-at-end-of-file: disable
comments: disable

Loading…
Cancel
Save