mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-20 04:30:06 +01:00
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:
parent
e5e41ce7f5
commit
b347cc8691
4 changed files with 12 additions and 13 deletions
|
|
@ -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', '.']
|
||||
|
|
|
|||
|
|
@ -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():
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue