Merge "Fix E731 flake8"

This commit is contained in:
Zuul 2019-06-21 12:53:03 +00:00 committed by Gerrit Code Review
commit d81225376a
4 changed files with 7 additions and 7 deletions

View File

@ -105,8 +105,8 @@ class TestDomainConfigs(unit.BaseTestCase):
name,
identity.DOMAIN_CONF_FTAIL)))
walk_fake = lambda *a, **kwa: (
('/fake/keystone/domains/config', [], files), )
def walk_fake(*a, **kwa):
return ('/fake/keystone/domains/config', [], files),
generic_driver = mock.Mock(is_sql=False)

View File

@ -88,7 +88,8 @@ class TestTemplatedCatalog(unit.TestCase, catalog_tests.CatalogTests):
"Templated backend doesn't have disabled endpoints")
def assert_catalogs_equal(self, expected, observed):
sort_key = lambda d: d['id']
def sort_key(d):
return d['id']
for e, o in zip(sorted(expected, key=sort_key),
sorted(observed, key=sort_key)):
expected_endpoints = e.pop('endpoints')

View File

@ -22,4 +22,4 @@ for FILE in $CHANGED; do
fi
done
diff -u --from-file /dev/null $CHECK | flake8 --diff --ignore=D100,D101,D102,D103,D104,E305,E402,E501,W503,W504,W605,E731
diff -u --from-file /dev/null $CHECK | flake8 --diff --ignore=D100,D101,D102,D103,D104,E305,E402,E501,W503,W504,W605

View File

@ -32,7 +32,7 @@ deps =
.[bandit]
{[testenv]deps}
commands =
flake8 --ignore=D100,D101,D102,D103,D104,E305,E402,E501,W503,W504,W605,E731
flake8 --ignore=D100,D101,D102,D103,D104,E305,E402,E501,W503,W504,W605
# Run bash8 during pep8 runs to ensure violations are caught by
# the check and gate queues
bashate devstack/plugin.sh
@ -127,8 +127,7 @@ enable-extensions = H203,H904
# TODO(wxy): Fix the pep8 issue.
# E402: module level import not at top of file
# W503: line break before binary operator
# E731: do not assign a lambda expression, use a def
ignore = D100,D101,D102,D103,D104,D203,E402,W503,E731
ignore = D100,D101,D102,D103,D104,D203,E402,W503
exclude=.venv,.git,.tox,build,dist,*lib/python*,*egg,tools,vendor,.update-venv,*.ini,*.po,*.pot
max-complexity=24