pre-commit: bump to latest ruff-format

And update our python files according to latest ruff format output.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1259>
This commit is contained in:
Peter Hutterer 2025-07-08 13:19:17 +10:00 committed by Marge Bot
parent e5e41ce7f5
commit b347cc8691
4 changed files with 12 additions and 13 deletions

View file

@ -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', '.']

View file

@ -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():

View file

@ -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