Merge "chore: Combine pep8 with whitespace linter"

This commit is contained in:
Zuul 2018-10-16 13:57:35 +00:00 committed by Gerrit Code Review
commit 6078774b34
4 changed files with 19 additions and 27 deletions

View File

@ -19,25 +19,18 @@
check:
jobs:
- openstack-tox-pep8
- airship-armada-linter
- airship-armada-lint-pep8
- airship-armada-ubuntu
- airship-armada-docker-build-gate
gate:
jobs:
- openstack-tox-pep8
- airship-armada-linter
- airship-armada-lint-pep8
- airship-armada-docker-build-gate
post:
jobs:
- airship-armada-docker-publish
- job:
name: airship-armada-linter
run: tools/gate/playbooks/zuul-linter.yaml
nodeset: airship-armada-single-node
- job:
name: airship-armada
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 != ""

View File

@ -0,0 +1,16 @@
#!/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" \
-not -name "*.html" \
-not -name "*.pyc" \
-type f -exec egrep -l " +$" {} \;)
if [[ -n $RES ]]; then
exit 1
fi

View File

@ -13,6 +13,7 @@ setenv=
usedevelop = True
install_command = pip install {opts} {packages}
whitelist_externals =
bash
find
rm
commands =
@ -69,6 +70,8 @@ deps =
.[bandit]
{[testenv]deps}
commands =
# Whitespace linter (for chart files)
bash {toxinidir}/tools/whitespace-linter.sh
yapf -dr {toxinidir}/armada {toxinidir}/setup.py
flake8 {posargs}
# Run security linter as part of the pep8 gate instead of a separate zuul job.