diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 62bd297b..7c495506 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,7 +7,7 @@ repos: - id: no-commit-to-branch args: ['--branch', 'main'] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.8.1 + rev: v0.12.2 hooks: - id: ruff args: ['--ignore=E741,E501', '--extend-exclude=subprojects', '.'] diff --git a/test/test_quirks_files.py b/test/test_quirks_files.py index 56fdd4cf..e828a48b 100755 --- a/test/test_quirks_files.py +++ b/test/test_quirks_files.py @@ -57,15 +57,15 @@ def test_matches_are_valid(quirksfile): vid = section.get("MatchVendor") if vid is not None: - assert re.match( - "0x[0-9A-F]{4}", vid - ), f"{quirksfile}: {name}: {vid} must be uppercase hex (0xAB12)" + assert re.match("0x[0-9A-F]{4}", vid), ( + f"{quirksfile}: {name}: {vid} must be uppercase hex (0xAB12)" + ) pid = section.get("MatchProduct") if pid is not None: - assert re.match( - "0x[0-9A-F]{4}", pid - ), f"{quirksfile}: {name}: {pid} must be uppercase hex (0xAB12)" + assert re.match("0x[0-9A-F]{4}", pid), ( + f"{quirksfile}: {name}: {pid} must be uppercase hex (0xAB12)" + ) def test_match_product_is_not_a_logitech_receiver(quirksfile): @@ -78,9 +78,9 @@ def test_match_product_is_not_a_logitech_receiver(quirksfile): vid = int(section.get("MatchVendor", "0x0"), 16) if vid == 0x046D: pid = int(section.get("MatchProduct", "0x0"), 16) - assert ( - pid not in logitech_receivers - ), f"{quirksfile}: {name}: applies to a Logitech Receiver" + assert pid not in logitech_receivers, ( + f"{quirksfile}: {name}: applies to a Logitech Receiver" + ) def main(): diff --git a/tools/libinput-analyze-recording.py b/tools/libinput-analyze-recording.py index b9ae3193..8186916c 100755 --- a/tools/libinput-analyze-recording.py +++ b/tools/libinput-analyze-recording.py @@ -192,7 +192,7 @@ def main(argv): print("") continuation_count = 0 - fields.insert(0, f"{e.sec: 3d}.{e.usec//1000:03d}") + fields.insert(0, f"{e.sec: 3d}.{e.usec // 1000:03d}") keys_down = [k.name for k, v in keystate.items() if v] fields.append(", ".join(keys_down)) print(" | ".join(fields)) diff --git a/tools/libinput-measure-touchpad-tap.py b/tools/libinput-measure-touchpad-tap.py index 3719228f..c59a3394 100755 --- a/tools/libinput-measure-touchpad-tap.py +++ b/tools/libinput-measure-touchpad-tap.py @@ -145,8 +145,7 @@ class Device(libevdev.Device): if not self.warned: self.warned = True error( - "\rThis tool cannot handle multiple fingers, " - "output will be invalid" + "\rThis tool cannot handle multiple fingers, output will be invalid" ) return