From e374a952af449dc54fb22b79990d746d95629c4e Mon Sep 17 00:00:00 2001 From: Gorka Eguileor Date: Thu, 21 Jan 2016 14:12:56 +0100 Subject: [PATCH] Run flake8 also on cinder/common Even though testenvs pep8 and pep8-constraints included cinder/common directory to be processed by flake8, global configuration in flake8 secion was excluding common glob preventing the directory from being checked. This patch removes glob from flake8 exclude section, unnecessary cinder/common inclusion when running flake8, and fixes cinder/common/config.py. If we had a common directory in our code root and wanted to exclude it, glob should be ./common instead of just common like we had now. Change-Id: Iefc64c02335ed9296bda323fdcb5688125fb4e77 --- cinder/common/config.py | 3 ++- tox.ini | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cinder/common/config.py b/cinder/common/config.py index f7181723f..4965fc290 100644 --- a/cinder/common/config.py +++ b/cinder/common/config.py @@ -171,7 +171,8 @@ global_opts = [ cfg.StrOpt('auth_strategy', default='keystone', choices=['noauth', 'keystone'], - help='The strategy to use for auth. Supports noauth or keystone.'), + help='The strategy to use for auth. Supports noauth or ' + 'keystone.'), cfg.ListOpt('enabled_backends', help='A list of backend names to use. These backend names ' 'should be backed by a unique [CONFIG] group ' diff --git a/tox.ini b/tox.ini index fb71b5829..934f836dd 100644 --- a/tox.ini +++ b/tox.ini @@ -43,7 +43,7 @@ commands = {[testenv:py34]commands} [testenv:pep8] commands = - flake8 {posargs} . cinder/common + flake8 {posargs} . # Check that .po and .pot files are valid: bash -c "find cinder -type f -regex '.*\.pot?' -print0|xargs -0 -n 1 msgfmt --check-format -o /dev/null" {toxinidir}/tools/config/check_uptodate.sh --checkopts @@ -53,7 +53,7 @@ commands = [testenv:pep8-constraints] install_command = {[testenv:common-constraints]install_command} commands = - flake8 {posargs} . cinder/common + flake8 {posargs} . # Check that .po and .pot files are valid: bash -c "find cinder -type f -regex '.*\.pot?' -print0|xargs -0 -n 1 msgfmt --check-format -o /dev/null" {toxinidir}/tools/config/check_uptodate.sh --checkopts @@ -122,7 +122,7 @@ commands = bandit -c tools/bandit.yaml -r cinder -n 5 -ll # E251 unexpected spaces around keyword / parameter equals # reason: no improvement in readability ignore = E251 -exclude = .git,.venv,.tox,dist,tools,doc,common,*egg,build +exclude = .git,.venv,.tox,dist,tools,doc,*egg,build max-complexity=30 [hacking] -- 2.45.2