From 1e1bf08346af37f0b89037e7134566287762e2ef Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Wed, 12 May 2021 02:24:13 -0500 Subject: [PATCH 1/2] ignore misc pylint false-positives --- contrib/runners/winrm_runner/winrm_runner/winrm_base.py | 1 + .../runners/winrm_runner/winrm_runner/winrm_command_runner.py | 1 + .../winrm_runner/winrm_runner/winrm_ps_command_runner.py | 1 + st2common/benchmarks/micro/test_mongo_field_types.py | 2 +- st2common/bin/migrations/v3.1/st2-cleanup-policy-delayed.py | 2 +- 5 files changed, 5 insertions(+), 2 deletions(-) diff --git a/contrib/runners/winrm_runner/winrm_runner/winrm_base.py b/contrib/runners/winrm_runner/winrm_runner/winrm_base.py index 8d35703138..f63d9c4be9 100644 --- a/contrib/runners/winrm_runner/winrm_runner/winrm_base.py +++ b/contrib/runners/winrm_runner/winrm_runner/winrm_base.py @@ -99,6 +99,7 @@ def __init__(self, response): class WinRmBaseRunner(ActionRunner): def pre_run(self): + # pylint: disable=unsubscriptable-object super(WinRmBaseRunner, self).pre_run() # common connection parameters diff --git a/contrib/runners/winrm_runner/winrm_runner/winrm_command_runner.py b/contrib/runners/winrm_runner/winrm_runner/winrm_command_runner.py index 1239f3efd5..d664a7c00e 100644 --- a/contrib/runners/winrm_runner/winrm_runner/winrm_command_runner.py +++ b/contrib/runners/winrm_runner/winrm_runner/winrm_command_runner.py @@ -29,6 +29,7 @@ class WinRmCommandRunner(WinRmBaseRunner): def run(self, action_parameters): + # pylint: disable=unsubscriptable-object cmd_command = self.runner_parameters[RUNNER_COMMAND] # execute diff --git a/contrib/runners/winrm_runner/winrm_runner/winrm_ps_command_runner.py b/contrib/runners/winrm_runner/winrm_runner/winrm_ps_command_runner.py index e6d0a37e2f..93fe0bc6b1 100644 --- a/contrib/runners/winrm_runner/winrm_runner/winrm_ps_command_runner.py +++ b/contrib/runners/winrm_runner/winrm_runner/winrm_ps_command_runner.py @@ -29,6 +29,7 @@ class WinRmPsCommandRunner(WinRmBaseRunner): def run(self, action_parameters): + # pylint: disable=unsubscriptable-object powershell_command = self.runner_parameters[RUNNER_COMMAND] # execute diff --git a/st2common/benchmarks/micro/test_mongo_field_types.py b/st2common/benchmarks/micro/test_mongo_field_types.py index 65cffaff22..54e5ead509 100644 --- a/st2common/benchmarks/micro/test_mongo_field_types.py +++ b/st2common/benchmarks/micro/test_mongo_field_types.py @@ -59,7 +59,7 @@ # Needed so we can subclass it -LiveActionDB._meta["allow_inheritance"] = True +LiveActionDB._meta["allow_inheritance"] = True # pylint: disable=no-member # 1. Current approach aka using EscapedDynamicField diff --git a/st2common/bin/migrations/v3.1/st2-cleanup-policy-delayed.py b/st2common/bin/migrations/v3.1/st2-cleanup-policy-delayed.py index 9d09789413..d367800ba6 100755 --- a/st2common/bin/migrations/v3.1/st2-cleanup-policy-delayed.py +++ b/st2common/bin/migrations/v3.1/st2-cleanup-policy-delayed.py @@ -46,7 +46,7 @@ def main(): except Exception as e: LOG.error( "ABORTED: Clean up of executions with deprecated policy-delayed status aborted on " - "first failure. %s" % e.message + "first failure. %s" % e.message # pylint: disable=no-member ) exit_code = 1 From 15f1955882e86c640bf3f20f0ae861847977ab8e Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Thu, 26 May 2022 19:48:26 -0500 Subject: [PATCH 2/2] make pylint ignore orjson --- lint-configs/python/.pylintrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lint-configs/python/.pylintrc b/lint-configs/python/.pylintrc index 8f3ff52af3..d19e02e3cc 100644 --- a/lint-configs/python/.pylintrc +++ b/lint-configs/python/.pylintrc @@ -26,7 +26,8 @@ property-classes=abc.abstractproperty [TYPECHECK] # Note: This modules are manipulated during the runtime so we can't detect all the properties during # static analysis -ignored-modules=distutils,eventlet.green.subprocess,six,six.moves +# orjson has type stubs, but pylint doesn't support __init__.pyi yet: https://github.com/PyCQA/pylint/issues/2873 +ignored-modules=distutils,eventlet.green.subprocess,six,six.moves,orjson [FORMAT] max-line-length=100