Skip to content

Commit 6ed5e39

Browse files
chore: update ruff to 0.1.13 and reformat codebase
1 parent c65b033 commit 6ed5e39

File tree

5 files changed

+16
-12
lines changed

5 files changed

+16
-12
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ repos:
1111
- id: check-yaml
1212

1313
- repo: https://github.com/astral-sh/ruff-pre-commit
14-
rev: v0.1.8
14+
rev: v0.1.13
1515
hooks:
1616
- id: ruff-format
1717
- id: ruff

compiler/api/compiler.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -203,14 +203,17 @@ def start(format: bool = False):
203203
shutil.rmtree(DESTINATION_PATH / "functions", ignore_errors=True)
204204
shutil.rmtree(DESTINATION_PATH / "base", ignore_errors=True)
205205

206-
with open(HOME_PATH / "source/auth_key.tl") as f1, open(
207-
HOME_PATH / "source/sys_msgs.tl"
208-
) as f2, open(HOME_PATH / "source/main_api.tl") as f3:
206+
with (
207+
open(HOME_PATH / "source/auth_key.tl") as f1,
208+
open(HOME_PATH / "source/sys_msgs.tl") as f2,
209+
open(HOME_PATH / "source/main_api.tl") as f3,
210+
):
209211
schema = (f1.read() + f2.read() + f3.read()).splitlines()
210212

211-
with open(HOME_PATH / "template/type.txt") as f1, open(
212-
HOME_PATH / "template/combinator.txt"
213-
) as f2:
213+
with (
214+
open(HOME_PATH / "template/type.txt") as f1,
215+
open(HOME_PATH / "template/combinator.txt") as f2,
216+
):
214217
type_tmpl = f1.read()
215218
combinator_tmpl = f2.read()
216219

compiler/errors/compiler.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,10 @@ def start():
7070
with Path(init).open("a", encoding="utf-8") as f_init:
7171
f_init.write(f"from .{name.lower()}_{code} import *\n")
7272

73-
with Path(f"{HOME}/source/{i}").open(encoding="utf-8") as f_csv, Path(
74-
f"{DEST}/{name.lower()}_{code}.py"
75-
).open("w", encoding="utf-8") as f_class:
73+
with (
74+
Path(f"{HOME}/source/{i}").open(encoding="utf-8") as f_csv,
75+
Path(f"{DEST}/{name.lower()}_{code}.py").open("w", encoding="utf-8") as f_class,
76+
):
7677
reader = csv.reader(f_csv, delimiter="\t")
7778

7879
super_class = caml(name)

hydrogram/methods/chats/set_chat_photo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ async def set_chat_photo(
8484
"""
8585
peer = await self.resolve_peer(chat_id)
8686

87-
if isinstance(photo, str) and Path(photo).is_file() or not isinstance(photo, str):
87+
if (isinstance(photo, str) and Path(photo).is_file()) or not isinstance(photo, str):
8888
photo = raw.types.InputChatUploadedPhoto(
8989
file=await self.save_file(photo),
9090
video=await self.save_file(video),

hydrogram/methods/messages/send_photo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ async def send_photo(
153153
file = None
154154

155155
try:
156-
if isinstance(photo, str) and Path(photo).is_file() or not isinstance(photo, str):
156+
if (isinstance(photo, str) and Path(photo).is_file()) or not isinstance(photo, str):
157157
file = await self.save_file(photo, progress=progress, progress_args=progress_args)
158158
media = raw.types.InputMediaUploadedPhoto(
159159
file=file,

0 commit comments

Comments
 (0)