Enable Comparison to None should use 'is' Error
Flake8 currently ignores comparison to None should be 'if cond is None' Enable E711 for more thorough testing of code Change-Id: I608cceff2eeb87c116bccddac26e3c869e5d57df Story: 2004515 Task: 30076 Signed-off-by: Eric Barrett <eric.barrett@windriver.com>
This commit is contained in:
parent
01cfb103bc
commit
360ad25564
@ -1429,7 +1429,7 @@ if __name__ == "__main__":
|
|||||||
SERVICES_INFO = tuple(config.get("ApiStatsServices", "API_STATS_STRUCTURE").split('|'))
|
SERVICES_INFO = tuple(config.get("ApiStatsServices", "API_STATS_STRUCTURE").split('|'))
|
||||||
for service_string in SERVICES_INFO:
|
for service_string in SERVICES_INFO:
|
||||||
service_tuple = tuple(service_string.split(';'))
|
service_tuple = tuple(service_string.split(';'))
|
||||||
if service_tuple[2] != "" and service_tuple[2] != None:
|
if service_tuple[2] != "" and service_tuple[2] is not None:
|
||||||
SERVICES[service_tuple[0]] = {'name': service_tuple[1], 'api-port': service_tuple[2]}
|
SERVICES[service_tuple[0]] = {'name': service_tuple[1], 'api-port': service_tuple[2]}
|
||||||
else:
|
else:
|
||||||
SERVICES[service_tuple[0]] = {'name': service_tuple[1], 'api-port': None}
|
SERVICES[service_tuple[0]] = {'name': service_tuple[1], 'api-port': None}
|
||||||
|
@ -1510,7 +1510,7 @@ def get_info_and_display(show=None):
|
|||||||
q = select([S.name,
|
q = select([S.name,
|
||||||
S.region_name,
|
S.region_name,
|
||||||
S.deleted_at]
|
S.deleted_at]
|
||||||
).where(S.deleted_at == None)
|
).where(S.deleted_at is None)
|
||||||
result = conn.execute(q)
|
result = conn.execute(q)
|
||||||
for row in result:
|
for row in result:
|
||||||
field = 'region_name'
|
field = 'region_name'
|
||||||
@ -1527,7 +1527,7 @@ def get_info_and_display(show=None):
|
|||||||
q = select([S.name,
|
q = select([S.name,
|
||||||
S.region_name,
|
S.region_name,
|
||||||
S.deleted_at]
|
S.deleted_at]
|
||||||
).where(S.deleted_at == None)
|
).where(S.deleted_at is None)
|
||||||
result = conn.execute(q)
|
result = conn.execute(q)
|
||||||
for row in result:
|
for row in result:
|
||||||
name = str(row['name'])
|
name = str(row['name'])
|
||||||
|
3
tox.ini
3
tox.ini
@ -62,7 +62,6 @@ commands =
|
|||||||
# E305 expected 2 blank lines after class or function definition, found 1
|
# E305 expected 2 blank lines after class or function definition, found 1
|
||||||
# E402 module level import not at top of file
|
# E402 module level import not at top of file
|
||||||
# E501 line too long > 80
|
# E501 line too long > 80
|
||||||
# E711 comparison to None should be 'if cond is None:'
|
|
||||||
# E722 do not use bare except'
|
# E722 do not use bare except'
|
||||||
# E741 ambiguous variable name 'O'
|
# E741 ambiguous variable name 'O'
|
||||||
# H series are hacking
|
# H series are hacking
|
||||||
@ -90,7 +89,7 @@ commands =
|
|||||||
# F401 'module' imported but unused
|
# F401 'module' imported but unused
|
||||||
# F841 local variable '_alarm_state' is assigned to but never used
|
# F841 local variable '_alarm_state' is assigned to but never used
|
||||||
ignore = E121,E123,E124,E125,E126,E127,E128,E201,E202,E203,E211,E221,E222,E225,E226,E231,E251,E261,E265,E266,
|
ignore = E121,E123,E124,E125,E126,E127,E128,E201,E202,E203,E211,E221,E222,E225,E226,E231,E251,E261,E265,E266,
|
||||||
E302,E303,E305,E402,E501,E711,E722,E741,
|
E302,E303,E305,E402,E501,E722,E741,
|
||||||
H101,H102,H104,H201,H238,H237,H306,H401,H404,H405,
|
H101,H102,H104,H201,H238,H237,H306,H401,H404,H405,
|
||||||
W191,W291,W391,W503,
|
W191,W291,W391,W503,
|
||||||
B001,B007,B301,B306,
|
B001,B007,B301,B306,
|
||||||
|
Loading…
Reference in New Issue
Block a user