Consolidate pep8/bandit zuul gating
This change adds the global zuul pep8 tox job, which runs both bandit and pep8 using tox. This also removes the two other airship specific lint-pep8 and bandit zuul jobs since they are both covered by the default openstack global one. Also cleaned up the tox.ini by moving the requirements into the test-requirements.txt file. Change-Id: Iab37a8090515936732e390b1f7c6d281e014e31c
This commit is contained in:
parent
7c98b5c4cb
commit
ad7e855cf8
34
.zuul.yaml
34
.zuul.yaml
@ -13,19 +13,17 @@
|
|||||||
- project:
|
- project:
|
||||||
check:
|
check:
|
||||||
jobs:
|
jobs:
|
||||||
|
- openstack-tox-pep8
|
||||||
- airship-pegleg-linter
|
- airship-pegleg-linter
|
||||||
- airship-pegleg-doc-build
|
- airship-pegleg-doc-build
|
||||||
- airship-pegleg-lint-pep8
|
|
||||||
- airship-pegleg-unit-py35
|
- airship-pegleg-unit-py35
|
||||||
- airship-pegleg-security-bandit
|
|
||||||
- airship-pegleg-docker-build-gate
|
- airship-pegleg-docker-build-gate
|
||||||
gate:
|
gate:
|
||||||
jobs:
|
jobs:
|
||||||
|
- openstack-tox-pep8
|
||||||
- airship-pegleg-linter
|
- airship-pegleg-linter
|
||||||
- airship-pegleg-doc-build
|
- airship-pegleg-doc-build
|
||||||
- airship-pegleg-lint-pep8
|
|
||||||
- airship-pegleg-unit-py35
|
- airship-pegleg-unit-py35
|
||||||
- airship-pegleg-security-bandit
|
|
||||||
- airship-pegleg-docker-build-gate
|
- airship-pegleg-docker-build-gate
|
||||||
post:
|
post:
|
||||||
jobs:
|
jobs:
|
||||||
@ -44,20 +42,6 @@
|
|||||||
run: tools/gate/playbooks/zuul-linter.yaml
|
run: tools/gate/playbooks/zuul-linter.yaml
|
||||||
nodeset: airship-pegleg-single-node
|
nodeset: airship-pegleg-single-node
|
||||||
|
|
||||||
- job:
|
|
||||||
name: airship-pegleg-lint-pep8
|
|
||||||
description: |
|
|
||||||
Lints Python files against the PEP8 standard
|
|
||||||
run: tools/gate/playbooks/pep8-linter.yaml
|
|
||||||
timeout: 300
|
|
||||||
nodeset: airship-pegleg-single-node
|
|
||||||
irrelevant-files:
|
|
||||||
- ^.*\.rst$
|
|
||||||
- ^doc/.*$
|
|
||||||
- ^etc/.*$
|
|
||||||
- ^releasenotes/.*$
|
|
||||||
- ^setup.cfg$
|
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: airship-pegleg-unit-py35
|
name: airship-pegleg-unit-py35
|
||||||
description: |
|
description: |
|
||||||
@ -72,20 +56,6 @@
|
|||||||
- ^releasenotes/.*$
|
- ^releasenotes/.*$
|
||||||
- ^setup.cfg$
|
- ^setup.cfg$
|
||||||
|
|
||||||
- job:
|
|
||||||
name: airship-pegleg-security-bandit
|
|
||||||
description: |
|
|
||||||
Executes the Bandit security scanner against Python files
|
|
||||||
run: tools/gate/playbooks/security-bandit.yaml
|
|
||||||
timeout: 300
|
|
||||||
nodeset: airship-pegleg-single-node
|
|
||||||
irrelevant-files:
|
|
||||||
- ^.*\.rst$
|
|
||||||
- ^doc/.*$
|
|
||||||
- ^etc/.*$
|
|
||||||
- ^releasenotes/.*$
|
|
||||||
- ^setup.cfg$
|
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: airship-pegleg-doc-build
|
name: airship-pegleg-doc-build
|
||||||
description: |
|
description: |
|
||||||
|
@ -3,8 +3,11 @@ pytest==3.2.1
|
|||||||
pytest-cov==2.5.1
|
pytest-cov==2.5.1
|
||||||
mock==2.0.0
|
mock==2.0.0
|
||||||
|
|
||||||
|
# Formatting
|
||||||
|
yapf==0.20.0
|
||||||
|
|
||||||
# Linting
|
# Linting
|
||||||
flake8==3.3.0
|
flake8==3.3.0
|
||||||
|
|
||||||
# Security
|
# Security
|
||||||
bandit==1.4.0
|
bandit>=1.5.0
|
||||||
|
@ -15,19 +15,22 @@ commands =
|
|||||||
{posargs}
|
{posargs}
|
||||||
|
|
||||||
[testenv:fmt]
|
[testenv:fmt]
|
||||||
deps = yapf==0.20.0
|
basepython=python3
|
||||||
|
deps =
|
||||||
|
-r{toxinidir}/test-requirements.txt
|
||||||
commands =
|
commands =
|
||||||
yapf --style=pep8 -ir {toxinidir}/pegleg {toxinidir}/tests
|
yapf --style=pep8 -ir {toxinidir}/pegleg {toxinidir}/tests
|
||||||
|
|
||||||
[testenv:pep8]
|
[testenv:pep8]
|
||||||
|
basepython=python3
|
||||||
deps =
|
deps =
|
||||||
yapf==0.20.0
|
-r{toxinidir}/test-requirements.txt
|
||||||
flake8==3.5.0
|
|
||||||
commands =
|
commands =
|
||||||
yapf -rd {toxinidir}/pegleg {toxinidir}/tests
|
|
||||||
flake8 {toxinidir}/pegleg
|
flake8 {toxinidir}/pegleg
|
||||||
|
bandit -r pegleg -n 5
|
||||||
|
|
||||||
[testenv:bandit]
|
[testenv:bandit]
|
||||||
|
basepython=python3
|
||||||
commands = bandit -r pegleg -n 5
|
commands = bandit -r pegleg -n 5
|
||||||
|
|
||||||
[flake8]
|
[flake8]
|
||||||
|
@ -1,20 +0,0 @@
|
|||||||
# 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 the make target for PEP8 linting
|
|
||||||
make:
|
|
||||||
chdir: "{{ zuul.project.src_dir }}"
|
|
||||||
target: py_lint
|
|
||||||
register: result
|
|
||||||
failed_when: result.failed
|
|
@ -1,20 +0,0 @@
|
|||||||
# 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 the make target for security scanning
|
|
||||||
make:
|
|
||||||
chdir: "{{ zuul.project.src_dir }}"
|
|
||||||
target: security
|
|
||||||
register: result
|
|
||||||
failed_when: result.failed
|
|
Loading…
x
Reference in New Issue
Block a user