From 5e489d8e41b513d8ff4557c771b49d04d4434d3a Mon Sep 17 00:00:00 2001 From: Chris Fournier Date: Fri, 14 Jul 2017 17:13:44 -0400 Subject: [PATCH] Add support for 'is' --- shopify_python/google_styleguide.py | 3 ++- tests/shopify_python/test_google_styleguide.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/shopify_python/google_styleguide.py b/shopify_python/google_styleguide.py index e9d1d62..b5cd012 100644 --- a/shopify_python/google_styleguide.py +++ b/shopify_python/google_styleguide.py @@ -131,7 +131,8 @@ class GoogleStyleGuideChecker(checkers.BaseChecker): "==": "eq", "!=": "ne", ">=": "ge", - ">": "gt" + ">": "gt", + "is": "is" } def visit_assign(self, node): # type: (astroid.Assign) -> None diff --git a/tests/shopify_python/test_google_styleguide.py b/tests/shopify_python/test_google_styleguide.py index e18dc47..21aaaea 100644 --- a/tests/shopify_python/test_google_styleguide.py +++ b/tests/shopify_python/test_google_styleguide.py @@ -274,7 +274,8 @@ def unaryfnc(): ('x == y', 'eq'), ('x != y', 'ne'), ('x >= y', 'ge'), - ('x > y', 'gt') + ('x > y', 'gt'), + ('x is y', 'is') ]) def test_binary_lambda_func(self, test_case): (expression, op_name) = test_case