Start running dib-lint again

A recent change that didn't fail with hard-tabs made me realise we're
not running tox -e pep8 ... which means we're not running dib-lint
which should find this (and other things).

I couldn't pinpoint when this happened; maybe job config was never in
this repo.

Anyway, move the pylint and dib-lint/flake8 testing to the now
standard "linters" and update the linting job to
openstack-tox-linters.

It looks like pylint is very lightly used (came in with
I7e24d8348db3aef79e1395d12692199a1f80161a and we've never expanded any
testing).  Leave this alone for now, but probably it is not important
any more.

This revealed some issues; updated flake8
(Iaa19c36f8cab8482a01f764c588375db8e7d8be3) found some spacing issues
with keywords and an update to elrepo to match our standard bash
flags.

Change-Id: I45bf108c467f7c8190ca252e6c48450c2622aaf8
This commit is contained in:
Ian Wienand 2022-09-02 16:14:09 +10:00
parent cbc0f5db28
commit 2a25db9ee6
No known key found for this signature in database
5 changed files with 9 additions and 10 deletions

View File

@ -9,7 +9,7 @@
- tripleo-buildimage-jobs-centos-8 - tripleo-buildimage-jobs-centos-8
check: check:
jobs: jobs:
- openstack-tox-pylint - openstack-tox-linters
- tox-py36: - tox-py36:
nodeset: nodeset:
nodes: nodes:
@ -55,7 +55,7 @@
- dib-functests-arm64-rpm - dib-functests-arm64-rpm
gate: gate:
jobs: jobs:
- openstack-tox-pylint - openstack-tox-linters
- tox-py36: - tox-py36:
nodeset: nodeset:
nodes: nodes:

View File

@ -60,7 +60,7 @@ class TestLVM(tc.TestGraphGeneration):
LVMPlugin, bad_config, {}, {}) LVMPlugin, bad_config, {}, {})
bad_config = copy.deepcopy(lvm_config) bad_config = copy.deepcopy(lvm_config)
del(bad_config['lvs'][0]['size']) del bad_config['lvs'][0]['size']
self.assertRaisesRegex(BlockDeviceSetupException, self.assertRaisesRegex(BlockDeviceSetupException,
"Missing 'size' or 'extents' in lvs config", "Missing 'size' or 'extents' in lvs config",
LVMPlugin, bad_config, {}, {}) LVMPlugin, bad_config, {}, {})

View File

@ -178,7 +178,7 @@ def _expand_element_dependencies(user_elements, all_elements):
raise MissingOSException("Please include an operating system element") raise MissingOSException("Please include an operating system element")
out = final_elements - provided out = final_elements - provided
return([all_elements[element] for element in out]) return [all_elements[element] for element in out]
def _find_all_elements(paths=None): def _find_all_elements(paths=None):

View File

@ -4,7 +4,8 @@ if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x set -x
fi fi
set -euo pipefail set -eu
set -o pipefail
case "$DISTRO_NAME" in case "$DISTRO_NAME" in
centos* | rhel* | rocky*) centos* | rhel* | rocky*)

View File

@ -1,5 +1,5 @@
[tox] [tox]
envlist = pep8,pylint,py3 envlist = pep8,linters,py3
minversion = 3.18.0 minversion = 3.18.0
skipsdist = True skipsdist = True
ignore_basepython_conflict = True ignore_basepython_conflict = True
@ -18,14 +18,12 @@ passenv=
deps = bindep deps = bindep
commands = bindep test commands = bindep test
[testenv:pep8] [testenv:linters]
commands = commands =
pylint --rcfile pylint.cfg diskimage_builder
flake8 {posargs} flake8 {posargs}
dib-lint dib-lint
[testenv:pylint]
commands = pylint --rcfile pylint.cfg diskimage_builder
[testenv:venv] [testenv:venv]
commands = {posargs} commands = {posargs}