style: add flags for pylint
diff --git a/serial/__init__.py b/serial/__init__.py
index 38c267b..7d60a8b 100644
--- a/serial/__init__.py
+++ b/serial/__init__.py
@@ -15,6 +15,7 @@
VERSION = '3.1a0'
+# pylint: disable=wrong-import-position
if sys.platform == 'cli':
from serial.serialcli import Serial
else:
diff --git a/serial/serialutil.py b/serial/serialutil.py
index f435007..7338b09 100644
--- a/serial/serialutil.py
+++ b/serial/serialutil.py
@@ -20,13 +20,13 @@
except (NameError, AttributeError):
# implementation does not matter as we do not realy use it.
# it just must not inherit from something else we might care for.
- class memoryview(object):
+ class memoryview(object): # pylint: disable=redefined-builtin,invalid-name
pass
try:
unicode
except (NameError, AttributeError):
- unicode = str # for Python 3
+ unicode = str # for Python 3, pylint: disable=redefined-builtin,invalid-name
# "for byte in data" fails for python3 as it returns ints instead of bytes
@@ -510,6 +510,7 @@
# - - - - - - - - - - - - - - - - - - - - - - - -
# backwards compatibility / deprecated functions
+ # pylint: disable=invalid-name,missing-docstring
def flushInput(self):
self.reset_input_buffer()
diff --git a/serial/serialwin32.py b/serial/serialwin32.py
index f7e3ba8..ade659e 100644
--- a/serial/serialwin32.py
+++ b/serial/serialwin32.py
@@ -9,6 +9,7 @@
#
# Initial patch to use ctypes by Giovanni Bajo <rasky@develer.com>
+# pylint: disable=invalid-name,too-few-public-methods
import ctypes
import time
from serial import win32
diff --git a/serial/threaded/__init__.py b/serial/threaded/__init__.py
index 43ab180..2671d0a 100644
--- a/serial/threaded/__init__.py
+++ b/serial/threaded/__init__.py
@@ -203,6 +203,7 @@
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# test
if __name__ == '__main__':
+ # pylint: disable=wrong-import-position
import sys
import time
import traceback
diff --git a/serial/urlhandler/protocol_hwgrep.py b/serial/urlhandler/protocol_hwgrep.py
index 824e6a8..9b3a082 100644
--- a/serial/urlhandler/protocol_hwgrep.py
+++ b/serial/urlhandler/protocol_hwgrep.py
@@ -26,11 +26,12 @@
try:
basestring
except NameError:
- basestring = str # python 3
+ basestring = str # python 3 pylint: disable=redefined-builtin
class Serial(serial.Serial):
"""Just inherit the native Serial port implementation and patch the port property."""
+ # pylint: disable=no-member
@serial.Serial.port.setter
def port(self, value):
diff --git a/serial/urlhandler/protocol_spy.py b/serial/urlhandler/protocol_spy.py
index 54bd55e..55563f9 100644
--- a/serial/urlhandler/protocol_spy.py
+++ b/serial/urlhandler/protocol_spy.py
@@ -145,6 +145,7 @@
class Serial(serial.Serial):
"""Just inherit the native Serial port implementation and patch the port property."""
+ # pylint: disable=no-member
def __init__(self, *args, **kwargs):
super(Serial, self).__init__(*args, **kwargs)
diff --git a/serial/win32.py b/serial/win32.py
index 15e6550..e7d625a 100644
--- a/serial/win32.py
+++ b/serial/win32.py
@@ -7,6 +7,7 @@
#
# SPDX-License-Identifier: BSD-3-Clause
+# pylint: disable=invalid-name,too-few-public-methods
from ctypes import c_ulong, c_void_p, c_int64, c_char, \
WinDLL, sizeof, Structure, Union, POINTER
from ctypes.wintypes import HANDLE