summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTin Lam <tin@irrational.io>2018-11-12 02:26:22 -0600
committerTin Lam <tin@irrational.io>2018-11-12 02:30:20 -0600
commit152b42bc3b32a624ed0748ceef1a911f268d9956 (patch)
treee3c16cdb50558a5fb27e8664ba86ba112c757aea
parent03634de6c8121b34c7c17c1bdbf2f4e71db310a7 (diff)
Consolidate linter jobs
Consolidating all the linting to a single job rather than having a one-off just to lint for trailing whitespaces. As most of this projects are python, this should already be covered by PEP8, but will be scanning for yamls with trailing whitespaces. Change-Id: Iee33a69ff234d21c08217faa33a19e11dfef0ad9 Signed-off-by: Tin Lam <tin@irrational.io>
Notes
Notes (review): Code-Review+2: Felipe Monteiro <felipe.monteiro@att.com> Code-Review+2: Aaron Sheffield <ajs@sheffieldfamily.net> Workflow+1: Aaron Sheffield <ajs@sheffieldfamily.net> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Tue, 13 Nov 2018 15:52:49 +0000 Reviewed-on: https://review.openstack.org/617247 Project: openstack/airship-pegleg Branch: refs/heads/master
-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