summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-11-13 15:52:49 +0000
committerGerrit Code Review <review@openstack.org>2018-11-13 15:52:49 +0000
commitec2ed74f05920992648e966de88df8b9e40ac75c (patch)
treea6585404dc64494b4ea8ddf9ebfede0126b76186
parent1f59d7e1e082bf45ff2d566a9e83c1f7bc001d6f (diff)
parent152b42bc3b32a624ed0748ceef1a911f268d9956 (diff)
Merge "Consolidate linter jobs"
-rw-r--r--.zuul.yaml9
-rw-r--r--tools/gate/playbooks/zuul-linter.yaml20
-rwxr-xr-xtools/gate/whitespace-linter.sh13
-rw-r--r--tox.ini3
4 files changed, 16 insertions, 29 deletions
diff --git a/.zuul.yaml b/.zuul.yaml
index 870b68e..ef87110 100644
--- a/.zuul.yaml
+++ b/.zuul.yaml
@@ -17,13 +17,11 @@
17 check: 17 check:
18 jobs: 18 jobs:
19 - openstack-tox-pep8 19 - openstack-tox-pep8
20 - airship-pegleg-linter
21 - airship-pegleg-doc-build 20 - airship-pegleg-doc-build
22 - airship-pegleg-docker-build-gate 21 - airship-pegleg-docker-build-gate
23 gate: 22 gate:
24 jobs: 23 jobs:
25 - openstack-tox-pep8 24 - openstack-tox-pep8
26 - airship-pegleg-linter
27 - airship-pegleg-doc-build 25 - airship-pegleg-doc-build
28 - airship-pegleg-docker-build-gate 26 - airship-pegleg-docker-build-gate
29 post: 27 post:
@@ -37,13 +35,6 @@
37 label: ubuntu-xenial 35 label: ubuntu-xenial
38 36
39- job: 37- job:
40 name: airship-pegleg-linter
41 description: |
42 Lints all files by checking them for whitespace.
43 run: tools/gate/playbooks/zuul-linter.yaml
44 nodeset: airship-pegleg-single-node
45
46- job:
47 name: airship-pegleg-doc-build 38 name: airship-pegleg-doc-build
48 description: | 39 description: |
49 Locally build the documentation to check for errors 40 Locally build the documentation to check for errors
diff --git a/tools/gate/playbooks/zuul-linter.yaml b/tools/gate/playbooks/zuul-linter.yaml
deleted file mode 100644
index 7a90371..0000000
--- a/tools/gate/playbooks/zuul-linter.yaml
+++ /dev/null
@@ -1,20 +0,0 @@
1# Copyright 2017 The Openstack-Helm Authors.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15- hosts: primary
16 tasks:
17 - name: Execute a Whitespace Linter check
18 command: find . -not -path "*/\.*" -not -path "*/doc/build/*" -not -path "*/doc/source/images/*" -not -name "*.tgz" -type f -exec egrep -l " +$" {} \;
19 register: result
20 failed_when: result.stdout != ""
diff --git a/tools/gate/whitespace-linter.sh b/tools/gate/whitespace-linter.sh
new file mode 100755
index 0000000..7e48b83
--- /dev/null
+++ b/tools/gate/whitespace-linter.sh
@@ -0,0 +1,13 @@
1#!/usr/bin/env bash
2
3set -xe
4RES=$(find . \
5 -not -path "*/\.*" \
6 -not -path "*/doc/build/*" \
7 -not -path "*/doc/source/images/*" \
8 -not -name "*.tgz" \
9 -type f -exec egrep -l " +$" {} \;)
10
11if [[ -n $RES ]]; then
12 exit 1;
13fi
diff --git a/tox.ini b/tox.ini
index bb2ce13..5f1f07b 100644
--- a/tox.ini
+++ b/tox.ini
@@ -31,8 +31,11 @@ basepython = python3
31deps = 31deps =
32 -r{toxinidir}/test-requirements.txt 32 -r{toxinidir}/test-requirements.txt
33commands = 33commands =
34 bash -c "{toxinidir}/tools/gate/whitespace-linter.sh"
34 bandit -r pegleg -n 5 35 bandit -r pegleg -n 5
35 flake8 {toxinidir}/pegleg 36 flake8 {toxinidir}/pegleg
37whitelist_externals =
38 bash
36 39
37[testenv:docs] 40[testenv:docs]
38basepython = python3 41basepython = python3