diff --git a/.pylintrc b/.pylintrc index 7a8b6d1..160794a 100644 --- a/.pylintrc +++ b/.pylintrc @@ -7,7 +7,7 @@ # A comma-separated list of package or module names from where C extensions may # be loaded. Extensions are loading into the active Python interpreter and may # run arbitrary code -extension-pkg-whitelist= +extension-pkg-whitelist=hid # Add files or directories to the ignore-list. They should be base names, not # paths. @@ -55,7 +55,7 @@ confidence= # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" # disable=import-error,raw-checker-failed,bad-inline-option,locally-disabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,deprecated-str-translate-call -disable=raw-checker-failed,bad-inline-option,locally-disabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,import-error,pointless-string-statement,unspecified-encoding +disable=raw-checker-failed,bad-inline-option,locally-disabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,import-error,pointless-string-statement,unspecified-encoding,import-outside-toplevel,too-many-branches,too-many-statements,too-many-public-methods # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option @@ -159,7 +159,7 @@ ignored-classes=optparse.Values,thread._local,_thread._local # (useful for modules/projects where namespaces are manipulated during runtime # and thus existing member attributes cannot be deduced by static analysis. It # supports qualified module names, as well as Unix pattern matching. -ignored-modules=board +ignored-modules= # Show a hint with possible names when a member name was not found. The aspect # of finding the hint is based on edit distance. diff --git a/adafruit_platformdetect/board.py b/adafruit_platformdetect/board.py index d78e408..48a6e24 100644 --- a/adafruit_platformdetect/board.py +++ b/adafruit_platformdetect/board.py @@ -35,7 +35,6 @@ __version__ = "0.0.0+auto.0" __repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_PlatformDetect.git" -# pylint: disable= too-many-public-methods class Board: """Attempt to detect specific boards.""" @@ -43,7 +42,7 @@ class Board: self.detector = detector self._board_id = None - # pylint: disable=invalid-name, protected-access, too-many-return-statements, too-many-lines, too-many-statements, too-many-branches + # pylint: disable=invalid-name, protected-access, too-many-return-statements, too-many-lines @property def id(self) -> Optional[str]: """Return a unique id for the detected board, if any.""" @@ -216,7 +215,7 @@ class Board: # Check for Pi boards: pi_rev_code = self._pi_rev_code() if pi_rev_code: - from adafruit_platformdetect.revcodes import ( # pylint: disable=import-outside-toplevel + from adafruit_platformdetect.revcodes import ( PiDecoder, ) @@ -697,7 +696,7 @@ class Board: # pylint: disable=too-many-return-statements def _rp2040_u2if_id(self) -> Optional[str]: - import hid # pylint: disable=import-outside-toplevel + import hid # look for it based on PID/VID for dev in hid.enumerate(): diff --git a/adafruit_platformdetect/chip.py b/adafruit_platformdetect/chip.py index ba260f5..9a167dd 100644 --- a/adafruit_platformdetect/chip.py +++ b/adafruit_platformdetect/chip.py @@ -63,7 +63,7 @@ class Chip: # Special cases controlled by environment var if os.environ.get("BLINKA_FT232H"): - from pyftdi.usbtools import ( # pylint: disable=import-outside-toplevel + from pyftdi.usbtools import ( UsbTools, ) @@ -77,7 +77,7 @@ class Chip: self._chip_id = chips.FT232H return self._chip_id if os.environ.get("BLINKA_FT2232H"): - from pyftdi.usbtools import ( # pylint: disable=import-outside-toplevel + from pyftdi.usbtools import ( UsbTools, ) @@ -91,7 +91,7 @@ class Chip: self._chip_id = chips.FT2232H return self._chip_id if os.environ.get("BLINKA_MCP2221"): - import hid # pylint: disable=import-outside-toplevel + import hid # look for it based on PID/VID for dev in hid.enumerate(): @@ -103,7 +103,7 @@ class Chip: + "set, but no MCP2221 device found" ) if os.environ.get("BLINKA_U2IF"): - import hid # pylint: disable=import-outside-toplevel + import hid # look for it based on PID/VID for dev in hid.enumerate(): @@ -145,7 +145,7 @@ class Chip: + "set, but no compatible device found" ) if os.environ.get("BLINKA_GREATFET"): - import usb # pylint: disable=import-outside-toplevel + import usb if usb.core.find(idVendor=0x1D50, idProduct=0x60E6) is not None: self._chip_id = chips.LPC4330