Skip to content

Commit

Permalink
fix the pylint unused-argument warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mkinney committed Jan 12, 2022
1 parent 48ed769 commit 0f89baa
Show file tree
Hide file tree
Showing 14 changed files with 291 additions and 155 deletions.
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -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,unused-argument,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-statement,global-variable-not-assigned,too-many-boolean-expressions,no-else-raise,bare-except,c-extension-no-member


[BASIC]
Expand Down
2 changes: 1 addition & 1 deletion meshtastic/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def onReceive(packet, interface):
print(f'Warning: There is no field {ex} in the packet.')


def onConnection(interface, topic=pub.AUTO_TOPIC):
def onConnection(interface, topic=pub.AUTO_TOPIC): # pylint: disable=W0613
"""Callback invoked when we connect/disconnect from a radio"""
print(f"Connection changed: {topic.getName()}")

Expand Down
2 changes: 1 addition & 1 deletion meshtastic/ble_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def __init__(self, address, noProto=False, debugOut=None):

self._readFromRadio() # read the initial responses

def handle_data(handle, data):
def handle_data(handle, data): # pylint: disable=W0613
self._handleFromRadio(data)

if self.device:
Expand Down
4 changes: 2 additions & 2 deletions meshtastic/mesh_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def __exit__(self, exc_type, exc_value, traceback):
logging.error(f'Traceback: {traceback}')
self.close()

def showInfo(self, file=sys.stdout):
def showInfo(self, file=sys.stdout): # pylint: disable=W0613
"""Show human readable summary about this object"""
owner = f"Owner: {self.getLongName()} ({self.getShortName()})"
myinfo = ''
Expand All @@ -100,7 +100,7 @@ def showInfo(self, file=sys.stdout):
print(infos)
return infos

def showNodes(self, includeSelf=True, file=sys.stdout):
def showNodes(self, includeSelf=True, file=sys.stdout): # pylint: disable=W0613
"""Show table summary of nodes in mesh"""
def formatFloat(value, precision=2, unit=''):
"""Format a float value with precsion."""
Expand Down
1 change: 1 addition & 0 deletions meshtastic/tests/test_ble_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ def test_BLEInterface(mock_platform):
"""Test that we can instantiate a BLEInterface"""
iface = BLEInterface('foo', debugOut=True, noProto=True)
iface.close()
mock_platform.assert_called()
Loading

0 comments on commit 0f89baa

Please sign in to comment.