diff --git a/.zuul.yaml b/.zuul.yaml index f767cee36..780c144b8 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -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 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..63bbdd091 --- /dev/null +++ b/tools/gate/playbooks/yamllint-config.yaml @@ -0,0 +1,19 @@ + +# 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