Skip to content

Commit 165efeb

Browse files
committed
Chore: Format code using Ruff 0.9
1 parent a9b3b4f commit 165efeb

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

pyproject.toml

+4-3
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,6 @@ lint.per-file-ignores."examples/*" = [
217217
"T201", # Allow `print`
218218
]
219219

220-
# ===================
221-
# Tasks configuration
222-
# ===================
223220
lint.per-file-ignores."tests/*" = [
224221
"S101", # Allow use of `assert`, and `print`.
225222
]
@@ -298,6 +295,10 @@ non_interactive = true
298295
method = "git"
299296
default-tag = "0.0.0"
300297

298+
# ===================
299+
# Tasks configuration
300+
# ===================
301+
301302
[tool.poe.tasks]
302303

303304
check = [

src/commons_codec/transform/mongodb.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ def to_sql(self, event: t.Dict[str, t.Any]) -> t.Union[SQLOperation, None]:
315315
oid: str = self.get_document_key(event)
316316
document = self.get_full_document(event)
317317
record = self.converter.decode_document(document)
318-
sql = f"INSERT INTO {self.table_name} " f"({self.ID_COLUMN}, {self.DATA_COLUMN}) " "VALUES (:oid, :record);"
318+
sql = f"INSERT INTO {self.table_name} ({self.ID_COLUMN}, {self.DATA_COLUMN}) VALUES (:oid, :record);"
319319
parameters = {"oid": oid, "record": record}
320320

321321
# In order to use "full document" representations from "update" events,
@@ -325,7 +325,7 @@ def to_sql(self, event: t.Dict[str, t.Any]) -> t.Union[SQLOperation, None]:
325325
document = self.get_full_document(event)
326326
record = self.converter.decode_document(document)
327327
where_clause = self.where_clause(event)
328-
sql = f"UPDATE {self.table_name} " f"SET {self.DATA_COLUMN} = :record " f"WHERE {where_clause};"
328+
sql = f"UPDATE {self.table_name} SET {self.DATA_COLUMN} = :record WHERE {where_clause};"
329329
parameters = {"record": record}
330330

331331
elif operation_type == "delete":

src/commons_codec/util/io.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# ruff: noqa: A005
12
# Copyright (c) 2016-2024, The Kotori Developers and contributors.
23
# Distributed under the terms of the LGPLv3 license, see LICENSE.
34
import json

src/commons_codec/vendor/boto3/dynamodb/types.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# ruff: noqa: A005
12
# Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
23
#
34
# Licensed under the Apache License, Version 2.0 (the "License"). You

tests/decode/test_sensor_community.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,6 @@ def assert_type(value: t.Any, type_: t.Type):
5858
"""
5959
Assertion helper with better error reporting.
6060
"""
61-
assert isinstance(
62-
value, type_
63-
), f"Value is of type '{type(value).__name__}', but should be '{type_.__name__}' instead"
61+
assert isinstance(value, type_), (
62+
f"Value is of type '{type(value).__name__}', but should be '{type_.__name__}' instead"
63+
)

0 commit comments

Comments
 (0)