chore(gate): consolidate zuul job

Moving the whitespace linting job as part of PEP8 job to reduce the need to
create a VM just to find whitespaces in none *.py files. Python files'
whitespace violation is covered as part of PEP8 job.

Change-Id: I3bc6047c9ab65e8f55f91a949a6c05ef4e38ea16
Signed-off-by: Tin Lam <tin@irrational.io>
This commit is contained in:
Tin Lam 2018-06-16 02:50:35 -05:00
parent 0143b2d727
commit d0f1f62b83
4 changed files with 17 additions and 29 deletions

View File

@ -17,7 +17,6 @@
jobs:
- airship-deckhand-tox-py27-postgresql
- airship-deckhand-tox-py35-postgresql
- airship-deckhand-linter
- airship-deckhand-ubuntu:
voting: false
- airship-deckhand-functional-docker-py35
@ -28,7 +27,6 @@
jobs:
- airship-deckhand-tox-py27-postgresql
- airship-deckhand-tox-py35-postgresql
- airship-deckhand-linter
# NOTE(portdirect): enable when voting enabled.
# - airship-deckhand-ubuntu:
# irrelevant-files:
@ -59,13 +57,6 @@
vars:
tox_envlist: py35-postgresql
- job:
name: airship-deckhand-linter
description: |
Lints all files by checking them for whitespace.
run: tools/gate/playbooks/zuul-linter.yaml
nodeset: openstack-helm-single-node
- job:
name: airship-deckhand-base
roles:

View File

@ -1,20 +0,0 @@
# Copyright 2017 The Openstack-Helm Authors.
#
# 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.
- hosts: primary
tasks:
- name: Execute a Whitespace Linter check
command: find . -not -path "*/\.*" -not -path "*/doc/build/*" -not -name "*.tgz" -type f -exec egrep -l " +$" {} \;
register: result
failed_when: result.stdout != ""

14
tools/whitespace-linter.sh Executable file
View File

@ -0,0 +1,14 @@
#!/usr/bin/env bash
set -xe
RES=$(find . \
-not -path "*/\.*" \
-not -path "*/*.egg-info/*" \
-not -path "*/releasenotes/build/*" \
-not -path "*/doc/build/*" \
-not -name "*.tgz" \
-type f -exec egrep -l " +$" {} \;)
if [[ -n $RES ]]; then
exit 1
fi

View File

@ -99,6 +99,9 @@ deps =
.[bandit]
{[testenv]deps}
commands =
# Whitespace linter
bash {toxinidir}/tools/whitespace-linter.sh
# Perform the actual pep8
flake8 {posargs}
# Run security linter as part of the pep8 gate instead of using separate job.
bandit -r deckhand -x deckhand/tests -n 5