Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Feb 10, 2025
1 parent aacaf57 commit 542db69
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
12 changes: 6 additions & 6 deletions test/test_data_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ def test_device_match(tabletfile):
"i2c",
"serial",
], f"{tabletfile}: unknown bus type"
assert re.match(
"[0-9a-f]{4}", vid
), f"{tabletfile}: {vid} must be lowercase hex"
assert re.match(
"[0-9a-f]{4}", pid
), f"{tabletfile}: {pid} must be lowercase hex"
assert re.match("[0-9a-f]{4}", vid), (
f"{tabletfile}: {vid} must be lowercase hex"
)
assert re.match("[0-9a-f]{4}", pid), (
f"{tabletfile}: {pid} must be lowercase hex"
)


def test_no_receiver_id(tabletfile):
Expand Down
18 changes: 9 additions & 9 deletions test/test_svg.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ def has_item(self, id: str, classes: Optional[List[str]] = None):
assert len(nodes) == 1, f"Expected one element with id {id}, have {len(nodes)}"
node = nodes[0]
for klass in classes or []:
assert klass in node.get("class", "").split(
" "
), f"Missing class '{klass}' for {id}. Have: {node.get('class')}"
assert klass in node.get("class", "").split(" "), (
f"Missing class '{klass}' for {id}. Have: {node.get('class')}"
)

@property
def name(self):
Expand Down Expand Up @@ -125,9 +125,9 @@ def test_svg_maybe_not_needed(svgdevice):
device.num_strips,
device.num_dials,
]
assert any(
x > 0 for x in features
), f"Device {device.name} has no buttons/rings/strips/dials and should not have an SVG"
assert any(x > 0 for x in features), (
f"Device {device.name} has no buttons/rings/strips/dials and should not have an SVG"
)


def has_item(root, id: str, classes: Optional[List[str]] = None):
Expand All @@ -136,9 +136,9 @@ def has_item(root, id: str, classes: Optional[List[str]] = None):
assert len(nodes) == 1, f"Expected on element with id {id}, have {len(nodes)}"
node = nodes[0]
for klass in classes or []:
assert klass in node.get("class").split(
" "
), f"Missing class '{klass}' for {id}. Have: {node.get('class')}"
assert klass in node.get("class").split(" "), (
f"Missing class '{klass}' for {id}. Have: {node.get('class')}"
)


def test_svg_rings(ringdevice):
Expand Down
2 changes: 1 addition & 1 deletion tools/show-stylus.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def load_data_files():
else:
die("Unable to find a libwacom.stylus data file")

print(f'Using stylus file(s): {", ".join([str(s) for s in stylusfiles])}')
print(f"Using stylus file(s): {', '.join([str(s) for s in stylusfiles])}")

styli = {}

Expand Down

0 comments on commit 542db69

Please sign in to comment.