Skip to content

Added pylint ignores so Actions will pass #51

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ install:
- pip install --force-reinstall "pylint<3"

script:
- pylint --disable=too-few-public-methods adafruit_ble/**/*.py adafruit_ble/*.py
- pylint adafruit_ble/**/*.py adafruit_ble/*.py
- ([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name,bad-whitespace
examples/*.py)
- circuitpython-build-bundles --filename_prefix adafruit-circuitpython-ble
Expand Down
2 changes: 2 additions & 0 deletions adafruit_ble/advertising/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ def encode_data(data_dict, *, key_encoding="B"):

class AdvertisingDataField:
"""Top level class for any descriptor classes that live in Advertisement or its subclasses."""
# pylint: disable=too-few-public-methods,unnecessary-pass
pass

class AdvertisingFlag:
"""A single bit flag within an AdvertisingFlags object."""
Expand Down
1 change: 1 addition & 0 deletions adafruit_ble/attributes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class Attribute:

security_mode: authenticated data signing, without man-in-the-middle protection
"""
# pylint: disable=too-few-public-methods
NO_ACCESS = _bleio.Attribute.NO_ACCESS
OPEN = _bleio.Attribute.OPEN
ENCRYPT_NO_MITM = _bleio.Attribute.ENCRYPT_NO_MITM
Expand Down
6 changes: 6 additions & 0 deletions adafruit_ble/characteristics/int.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,30 +60,36 @@ def __set__(self, obj, value):

class Int8Characteristic(IntCharacteristic):
"""Int8 number."""
# pylint: disable=too-few-public-methods
def __init__(self, *, min_value=-128, max_value=127, **kwargs):
super().__init__("<b", min_value, max_value, **kwargs)

class Uint8Characteristic(IntCharacteristic):
"""Uint8 number."""
# pylint: disable=too-few-public-methods
def __init__(self, *, min_value=0, max_value=0xff, **kwargs):
super().__init__("<B", min_value, max_value, **kwargs)

class Int16Characteristic(IntCharacteristic):
"""Int16 number."""
# pylint: disable=too-few-public-methods
def __init__(self, *, min_value=-32768, max_value=32767, **kwargs):
super().__init__("<h", min_value, max_value, **kwargs)

class Uint16Characteristic(IntCharacteristic):
"""Uint16 number."""
# pylint: disable=too-few-public-methods
def __init__(self, *, min_value=0, max_value=0xffff, **kwargs):
super().__init__("<H", min_value, max_value, **kwargs)

class Int32Characteristic(IntCharacteristic):
"""Int32 number."""
# pylint: disable=too-few-public-methods
def __init__(self, *, min_value=-2147483648, max_value=2147483647, **kwargs):
super().__init__("<i", min_value, max_value, **kwargs)

class Uint32Characteristic(IntCharacteristic):
"""Uint32 number."""
# pylint: disable=too-few-public-methods
def __init__(self, *, min_value=0, max_value=0xffffffff, **kwargs):
super().__init__("<I", min_value, max_value, **kwargs)
1 change: 1 addition & 0 deletions adafruit_ble/services/midi.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

class MidiIOCharacteristic(Characteristic):
"""Workhorse MIDI Characteristic that carries midi messages both directions. Unimplemented."""
# pylint: disable=too-few-public-methods
uuid = VendorUUID("7772E5DB-3868-4112-A1A9-F2669D106BF3")
def __init__(self, **kwargs):
super().__init__(properties=(Characteristic.NOTIFY |
Expand Down
1 change: 1 addition & 0 deletions adafruit_ble/services/standard/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@

class AppearanceCharacteristic(StructCharacteristic):
"""What type of device it is"""
# pylint: disable=too-few-public-methods
uuid = StandardUUID(0x2a01)

def __init__(self, **kwargs):
Expand Down
4 changes: 3 additions & 1 deletion adafruit_ble/services/standard/hid.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ def send_report(self, report):

class ReportOut:
"""A single HID report that receives HID data from a client."""
# pylint: disable=too-few-public-methods
uuid = StandardUUID(_REPORT_UUID_NUM)
def __init__(self, service, report_id, usage_page, usage, *, max_length):
self._characteristic = _bleio.Characteristic.add_to_service(
Expand Down Expand Up @@ -248,6 +249,7 @@ def _init_devices(self):
i += size

def get_report_info(collection, reports):
""" Gets info about hid reports """
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like an accurate if brief description. It can be filled out more if need be.

for main in collection["mains"]:
if "type" in main:
get_report_info(main, reports)
Expand All @@ -269,7 +271,7 @@ def get_report_info(collection, reports):
reports = {}
get_report_info(collection, reports)
if len(reports) > 1:
raise NotImplementedError("Only on report id per Application collection supported")
raise NotImplementedError("Only one report id per Application collection supported")

report_id, report = list(reports.items())[0]
output_size = report["output_size"]
Expand Down