From 87befaaad38f9064152cac1aea98846f14db0196 Mon Sep 17 00:00:00 2001 From: Blake Dittmer Date: Tue, 12 Nov 2019 12:28:26 -0600 Subject: [PATCH] trying to figure out "non-zero return code" Change-Id: I1cc6a10b4ed235b952b1d411213f3f1543d6c932 --- .zuul.yaml | 6 ++---- tools/gate/install-yaml-lint.sh | 3 +-- tools/gate/lintyaml.sh | 15 ++++++++++++- tools/gate/playbooks/lint-yaml.yaml | 10 ++++++--- tools/gate/playbooks/yamllint-config.yaml | 26 +++++++++++++++++++++++ 5 files changed, 50 insertions(+), 10 deletions(-) create mode 100644 tools/gate/playbooks/yamllint-config.yaml diff --git a/.zuul.yaml b/.zuul.yaml index f767cee36..164bb1afd 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -40,7 +40,6 @@ jobs: - treasuremap-upload-git-mirror - - nodeset: name: treasuremap-single-node nodes: @@ -62,6 +61,7 @@ irrelevant-files: - ^.*\.rst$ - ^doc/.*$ + - job: name: treasuremap-yaml-lint nodeset: treasuremap-single-node @@ -69,9 +69,7 @@ run: tools/gate/playbooks/lint-yaml.yaml voting: true irrelevant-files: - - ^.*\.rst$ - - ^doc/.*$ - + - ^py/.*$ - job: name: treasuremap-seaworthy-site-lint diff --git a/tools/gate/install-yaml-lint.sh b/tools/gate/install-yaml-lint.sh index 046830ce5..1a479cf76 100755 --- a/tools/gate/install-yaml-lint.sh +++ b/tools/gate/install-yaml-lint.sh @@ -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 diff --git a/tools/gate/lintyaml.sh b/tools/gate/lintyaml.sh index a65372ac6..11518d788 100755 --- a/tools/gate/lintyaml.sh +++ b/tools/gate/lintyaml.sh @@ -1,2 +1,15 @@ +# Copyright 2018 AT&T Intellectual Property. All other rights reserved. +# +# 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. #!/bin/bash -yamllint . +yamllint -c ./tools/gate/playbooks/yamllint-config.yaml . diff --git a/tools/gate/playbooks/lint-yaml.yaml b/tools/gate/playbooks/lint-yaml.yaml index 9d0f869fb..0e23c1241 100644 --- a/tools/gate/playbooks/lint-yaml.yaml +++ b/tools/gate/playbooks/lint-yaml.yaml @@ -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 + diff --git a/tools/gate/playbooks/yamllint-config.yaml b/tools/gate/playbooks/yamllint-config.yaml new file mode 100644 index 000000000..4db579ff5 --- /dev/null +++ b/tools/gate/playbooks/yamllint-config.yaml @@ -0,0 +1,26 @@ +# Copyright 2018 AT&T Intellectual Property. All other rights reserved. +# +# 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