From ba00bd454befd5a9068f14f224db4f5eadcfd328 Mon Sep 17 00:00:00 2001 From: Ruslan Kamaldinov Date: Fri, 14 Nov 2014 03:25:05 +0300 Subject: [PATCH] Enable H902 collection membership evaluation Change-Id: Ie6fd9f44f8a682397c7b34d4be69bb64351f7558 --- tox.ini | 3 +-- yaql/functions/ns.py | 2 +- yaql/language/context.py | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/tox.ini b/tox.ini index d11522b..8243542 100644 --- a/tox.ini +++ b/tox.ini @@ -31,8 +31,7 @@ commands = python setup.py build_sphinx ## TODO(ruhe) following checks should be fixed # E721 do not compare types, use 'isinstance()' # H306 imports not in alphabetical order -# H902 Use the 'not in' operator for collection membership evaluation show-source = True -ignore = E123,E125,E721,H306,H404,H803,H902 +ignore = E123,E125,E721,H306,H404,H803 builtins = _ exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build diff --git a/yaql/functions/ns.py b/yaql/functions/ns.py index 974dd38..37e0688 100644 --- a/yaql/functions/ns.py +++ b/yaql/functions/ns.py @@ -33,7 +33,7 @@ class Namespace(object): self.symbols = symbols def validate(self, symbol): - if not symbol in self.symbols: + if symbol not in self.symbols: raise NamespaceValidationException(self.name, symbol) diff --git a/yaql/language/context.py b/yaql/language/context.py index 954a13b..a2d9d3c 100644 --- a/yaql/language/context.py +++ b/yaql/language/context.py @@ -48,9 +48,9 @@ class Context(): if not name: name = func_def.function.func_name - if not name in self.functions: + if name not in self.functions: self.functions[name] = {} - if not num_params in self.functions[name]: + if num_params not in self.functions[name]: self.functions[name][num_params] = [func_def] else: self.functions[name][num_params].append(func_def)