diff --git a/lgtm.yml b/lgtm.yml new file mode 100644 index 00000000000000..bf58e10c0a3c2b --- /dev/null +++ b/lgtm.yml @@ -0,0 +1,3 @@ +queries: + - exclude: py/unused-import + - exclude: py/polluting-import diff --git a/src/controller/python/chip/ChipDeviceCtrl.py b/src/controller/python/chip/ChipDeviceCtrl.py index 64e9b3ee7792cc..8dabea2710b89c 100644 --- a/src/controller/python/chip/ChipDeviceCtrl.py +++ b/src/controller/python/chip/ChipDeviceCtrl.py @@ -392,11 +392,11 @@ def DeviceAvailableCallback(device, err): # The callback might have been received synchronously (during self._ChipStack.Call()). # Check if the device is already set before waiting for the callback. - if returnDevice.value == None: + if returnDevice.value is None: with deviceAvailableCV: deviceAvailableCV.wait() - if returnDevice.value == None: + if returnDevice.value is None: raise self._ChipStack.ErrorToException(CHIP_ERROR_INTERNAL) return returnDevice diff --git a/src/controller/python/chip/ChipReplStartup.py b/src/controller/python/chip/ChipReplStartup.py index c314d11394a3fc..6025f7d0c3c61a 100644 --- a/src/controller/python/chip/ChipReplStartup.py +++ b/src/controller/python/chip/ChipReplStartup.py @@ -41,7 +41,7 @@ def ReplInit(): def matterhelp(classOrObj=None): - if (classOrObj == None): + if (classOrObj is None): inspect(builtins.devCtrl, methods=True, help=True, private=False) inspect(mattersetlog) inspect(mattersetdebug) diff --git a/src/controller/python/chip/clusters/Command.py b/src/controller/python/chip/clusters/Command.py index 179c4ed9959da1..e097184297b518 100644 --- a/src/controller/python/chip/clusters/Command.py +++ b/src/controller/python/chip/clusters/Command.py @@ -74,7 +74,7 @@ def _handleResponse(self, path: CommandPath, status: Status, response: bytes): self._future.set_result(None) else: # If a type hasn't been assigned, let's auto-deduce it. - if (self._expect_type == None): + if (self._expect_type is None): self._expect_type = FindCommandClusterObject(False, path) if self._expect_type: diff --git a/src/controller/python/chip/interaction_model/__init__.py b/src/controller/python/chip/interaction_model/__init__.py index 1fbfde26668752..2bd904226112ff 100644 --- a/src/controller/python/chip/interaction_model/__init__.py +++ b/src/controller/python/chip/interaction_model/__init__.py @@ -26,7 +26,7 @@ from chip.exceptions import ChipStackException -__all__ = ["IMDelegate", "Status", "InteractionModelError"] +__all__ = ["Status", "InteractionModelError"] class Status(enum.IntEnum):