From 720150616d6743f93eae13882c736e0d03b7855f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20NEDJAR?= Date: Sat, 28 Mar 2026 18:39:44 +0100 Subject: [PATCH 1/2] tooling: Enable ruff A, B, E722, and PERF rules. --- lib/apds9960/apds9960/exceptions.py | 4 ++-- lib/bq27441/bq27441/device.py | 4 ++-- lib/ism330dl/examples/static_orientation.py | 4 ++-- lib/lis2mdl/examples/tilt_compensated_heading.py | 2 +- lib/ssd1327/examples/framebuf_scroll.py | 2 +- lib/ssd1327/examples/random_pixels.py | 2 +- pyproject.toml | 6 ++++-- tests/runner/mpremote_bridge.py | 4 ++-- 8 files changed, 15 insertions(+), 13 deletions(-) diff --git a/lib/apds9960/apds9960/exceptions.py b/lib/apds9960/apds9960/exceptions.py index b297e3b1..8e98e1ae 100644 --- a/lib/apds9960/apds9960/exceptions.py +++ b/lib/apds9960/apds9960/exceptions.py @@ -1,9 +1,9 @@ class APDS9960InvalidDevId(ValueError): - def __init__(self, id, valid_ids): + def __init__(self, device_id, valid_ids): Exception.__init__( self, "Device id 0x{} is not a valid one (valid: {})!".format( - format(id, "02x"), + format(device_id, "02x"), ", ".join(["0x{}".format(format(i, "02x")) for i in valid_ids]), ), ) diff --git a/lib/bq27441/bq27441/device.py b/lib/bq27441/bq27441/device.py index 83a5150e..74b97dec 100644 --- a/lib/bq27441/bq27441/device.py +++ b/lib/bq27441/bq27441/device.py @@ -470,9 +470,9 @@ def soft_reset(self): return self.execute_control_word(BQ27441_CONTROL_SOFT_RESET) # Read a 16 - bit command word from the BQ27441-G1A, def format = little endian int16 - def read_word(self, sub_address, format=" Date: Sat, 28 Mar 2026 18:45:17 +0100 Subject: [PATCH 2/2] tooling: Fix Copilot review comments on ruff rules PR. --- lib/bq27441/bq27441/device.py | 2 +- pyproject.toml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/bq27441/bq27441/device.py b/lib/bq27441/bq27441/device.py index 74b97dec..cba16a54 100644 --- a/lib/bq27441/bq27441/device.py +++ b/lib/bq27441/bq27441/device.py @@ -469,7 +469,7 @@ def reset(self): def soft_reset(self): return self.execute_control_word(BQ27441_CONTROL_SOFT_RESET) - # Read a 16 - bit command word from the BQ27441-G1A, def format = little endian int16 + # Read a 16-bit command word from the BQ27441-G1A, default fmt = little-endian int16 def read_word(self, sub_address, fmt="