Fix config and unlint
This commit is contained in:
parent
1b1ab2f988
commit
8820fe87aa
3 changed files with 11 additions and 12 deletions
|
|
@ -7,7 +7,7 @@
|
||||||
# A comma-separated list of package or module names from where C extensions may
|
# 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
|
# be loaded. Extensions are loading into the active Python interpreter and may
|
||||||
# run arbitrary code
|
# run arbitrary code
|
||||||
extension-pkg-whitelist=
|
extension-pkg-whitelist=hid
|
||||||
|
|
||||||
# Add files or directories to the ignore-list. They should be base names, not
|
# Add files or directories to the ignore-list. They should be base names, not
|
||||||
# paths.
|
# paths.
|
||||||
|
|
@ -55,7 +55,7 @@ confidence=
|
||||||
# no Warning level messages displayed, use"--disable=all --enable=classes
|
# no Warning level messages displayed, use"--disable=all --enable=classes
|
||||||
# --disable=W"
|
# --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=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
|
# 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
|
# 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
|
# (useful for modules/projects where namespaces are manipulated during runtime
|
||||||
# and thus existing member attributes cannot be deduced by static analysis. It
|
# and thus existing member attributes cannot be deduced by static analysis. It
|
||||||
# supports qualified module names, as well as Unix pattern matching.
|
# 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
|
# Show a hint with possible names when a member name was not found. The aspect
|
||||||
# of finding the hint is based on edit distance.
|
# of finding the hint is based on edit distance.
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,6 @@ __version__ = "0.0.0+auto.0"
|
||||||
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_PlatformDetect.git"
|
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_PlatformDetect.git"
|
||||||
|
|
||||||
|
|
||||||
# pylint: disable= too-many-public-methods
|
|
||||||
class Board:
|
class Board:
|
||||||
"""Attempt to detect specific boards."""
|
"""Attempt to detect specific boards."""
|
||||||
|
|
||||||
|
|
@ -43,7 +42,7 @@ class Board:
|
||||||
self.detector = detector
|
self.detector = detector
|
||||||
self._board_id = None
|
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
|
@property
|
||||||
def id(self) -> Optional[str]:
|
def id(self) -> Optional[str]:
|
||||||
"""Return a unique id for the detected board, if any."""
|
"""Return a unique id for the detected board, if any."""
|
||||||
|
|
@ -216,7 +215,7 @@ class Board:
|
||||||
# Check for Pi boards:
|
# Check for Pi boards:
|
||||||
pi_rev_code = self._pi_rev_code()
|
pi_rev_code = self._pi_rev_code()
|
||||||
if pi_rev_code:
|
if pi_rev_code:
|
||||||
from adafruit_platformdetect.revcodes import ( # pylint: disable=import-outside-toplevel
|
from adafruit_platformdetect.revcodes import (
|
||||||
PiDecoder,
|
PiDecoder,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -697,7 +696,7 @@ class Board:
|
||||||
# pylint: disable=too-many-return-statements
|
# pylint: disable=too-many-return-statements
|
||||||
|
|
||||||
def _rp2040_u2if_id(self) -> Optional[str]:
|
def _rp2040_u2if_id(self) -> Optional[str]:
|
||||||
import hid # pylint: disable=import-outside-toplevel
|
import hid
|
||||||
|
|
||||||
# look for it based on PID/VID
|
# look for it based on PID/VID
|
||||||
for dev in hid.enumerate():
|
for dev in hid.enumerate():
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ class Chip:
|
||||||
|
|
||||||
# Special cases controlled by environment var
|
# Special cases controlled by environment var
|
||||||
if os.environ.get("BLINKA_FT232H"):
|
if os.environ.get("BLINKA_FT232H"):
|
||||||
from pyftdi.usbtools import ( # pylint: disable=import-outside-toplevel
|
from pyftdi.usbtools import (
|
||||||
UsbTools,
|
UsbTools,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -77,7 +77,7 @@ class Chip:
|
||||||
self._chip_id = chips.FT232H
|
self._chip_id = chips.FT232H
|
||||||
return self._chip_id
|
return self._chip_id
|
||||||
if os.environ.get("BLINKA_FT2232H"):
|
if os.environ.get("BLINKA_FT2232H"):
|
||||||
from pyftdi.usbtools import ( # pylint: disable=import-outside-toplevel
|
from pyftdi.usbtools import (
|
||||||
UsbTools,
|
UsbTools,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -91,7 +91,7 @@ class Chip:
|
||||||
self._chip_id = chips.FT2232H
|
self._chip_id = chips.FT2232H
|
||||||
return self._chip_id
|
return self._chip_id
|
||||||
if os.environ.get("BLINKA_MCP2221"):
|
if os.environ.get("BLINKA_MCP2221"):
|
||||||
import hid # pylint: disable=import-outside-toplevel
|
import hid
|
||||||
|
|
||||||
# look for it based on PID/VID
|
# look for it based on PID/VID
|
||||||
for dev in hid.enumerate():
|
for dev in hid.enumerate():
|
||||||
|
|
@ -103,7 +103,7 @@ class Chip:
|
||||||
+ "set, but no MCP2221 device found"
|
+ "set, but no MCP2221 device found"
|
||||||
)
|
)
|
||||||
if os.environ.get("BLINKA_U2IF"):
|
if os.environ.get("BLINKA_U2IF"):
|
||||||
import hid # pylint: disable=import-outside-toplevel
|
import hid
|
||||||
|
|
||||||
# look for it based on PID/VID
|
# look for it based on PID/VID
|
||||||
for dev in hid.enumerate():
|
for dev in hid.enumerate():
|
||||||
|
|
@ -145,7 +145,7 @@ class Chip:
|
||||||
+ "set, but no compatible device found"
|
+ "set, but no compatible device found"
|
||||||
)
|
)
|
||||||
if os.environ.get("BLINKA_GREATFET"):
|
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:
|
if usb.core.find(idVendor=0x1D50, idProduct=0x60E6) is not None:
|
||||||
self._chip_id = chips.LPC4330
|
self._chip_id = chips.LPC4330
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue