Browse Source

Merge "Consolidate linter jobs"

Zuul 5 months ago
parent
commit
ec2ed74f05
4 changed files with 16 additions and 29 deletions
  1. 0
    9
      .zuul.yaml
  2. 0
    20
      tools/gate/playbooks/zuul-linter.yaml
  3. 13
    0
      tools/gate/whitespace-linter.sh
  4. 3
    0
      tox.ini

+ 0
- 9
.zuul.yaml View File

@@ -17,13 +17,11 @@
17 17
     check:
18 18
       jobs:
19 19
         - openstack-tox-pep8
20
-        - airship-pegleg-linter
21 20
         - airship-pegleg-doc-build
22 21
         - airship-pegleg-docker-build-gate
23 22
     gate:
24 23
       jobs:
25 24
         - openstack-tox-pep8
26
-        - airship-pegleg-linter
27 25
         - airship-pegleg-doc-build
28 26
         - airship-pegleg-docker-build-gate
29 27
     post:
@@ -36,13 +34,6 @@
36 34
       - name: primary
37 35
         label: ubuntu-xenial
38 36
 
39
-- 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 37
 - job:
47 38
     name: airship-pegleg-doc-build
48 39
     description: |

+ 0
- 20
tools/gate/playbooks/zuul-linter.yaml View File

@@ -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 != ""

+ 13
- 0
tools/gate/whitespace-linter.sh View File

@@ -0,0 +1,13 @@
1
+#!/usr/bin/env bash
2
+
3
+set -xe
4
+RES=$(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
+
11
+if [[ -n $RES ]]; then
12
+  exit 1;
13
+fi

+ 3
- 0
tox.ini View File

@@ -31,8 +31,11 @@ basepython = python3
31 31
 deps =
32 32
   -r{toxinidir}/test-requirements.txt
33 33
 commands =
34
+  bash -c "{toxinidir}/tools/gate/whitespace-linter.sh"
34 35
   bandit -r pegleg -n 5
35 36
   flake8 {toxinidir}/pegleg
37
+whitelist_externals =
38
+  bash
36 39
 
37 40
 [testenv:docs]
38 41
 basepython = python3

Loading…
Cancel
Save