From e7680e07c23346fae4bb65081975bc5fcfc11a78 Mon Sep 17 00:00:00 2001 From: Mike Kinney Date: Wed, 12 Jan 2022 14:46:21 -0800 Subject: [PATCH] fix pylint global-statement warnings --- .pylintrc | 2 +- meshtastic/test.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.pylintrc b/.pylintrc index 8228bf4..6f3f472 100644 --- a/.pylintrc +++ b/.pylintrc @@ -23,7 +23,7 @@ ignore-patterns=mqtt_pb2.py,channel_pb2.py,environmental_measurement_pb2.py,admi # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" # -disable=invalid-name,fixme,logging-fstring-interpolation,too-many-statements,too-many-branches,too-many-locals,no-member,f-string-without-interpolation,protected-access,no-self-use,pointless-string-statement,too-few-public-methods,broad-except,no-else-return,global-statement,global-variable-not-assigned,too-many-boolean-expressions,no-else-raise,bare-except,c-extension-no-member +disable=invalid-name,fixme,logging-fstring-interpolation,too-many-statements,too-many-branches,too-many-locals,no-member,f-string-without-interpolation,protected-access,no-self-use,pointless-string-statement,too-few-public-methods,broad-except,no-else-return,global-variable-not-assigned,too-many-boolean-expressions,no-else-raise,bare-except,c-extension-no-member [BASIC] diff --git a/meshtastic/test.py b/meshtastic/test.py index bedae30..c41ee60 100644 --- a/meshtastic/test.py +++ b/meshtastic/test.py @@ -63,6 +63,7 @@ def testSend(fromInterface, toInterface, isBroadcast=False, asBinary=False, want Returns: boolean -- True for success """ + # pylint: disable=W0603 global receivedPackets receivedPackets = [] fromNode = fromInterface.myInfo.my_node_num @@ -74,6 +75,7 @@ def testSend(fromInterface, toInterface, isBroadcast=False, asBinary=False, want logging.debug( f"Sending test wantAck={wantAck} packet from {fromNode} to {toNode}") + # pylint: disable=W0603 global sendingInterface sendingInterface = fromInterface if not asBinary: @@ -94,6 +96,7 @@ def runTests(numTests=50, wantAck=False, maxFailures=0): numFail = 0 numSuccess = 0 for _ in range(numTests): + # pylint: disable=W0603 global testNumber testNumber = testNumber + 1 isBroadcast = True @@ -152,6 +155,7 @@ def testAll(numTests=5): pub.subscribe(onConnection, "meshtastic.connection") pub.subscribe(onReceive, "meshtastic.receive") + # pylint: disable=W0603 global interfaces interfaces = list(map(lambda port: SerialInterface( port, debugOut=openDebugLog(port), connectNow=True), ports))