Skip to content

Commit 6ae3515

Browse files
authored
fix(api-nodes): enable more pylint rules (#10213)
1 parent 6bd3f8e commit 6ae3515

File tree

4 files changed

+7
-12
lines changed

4 files changed

+7
-12
lines changed

comfy_api_nodes/apinode_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def validate_aspect_ratio(
152152
raise TypeError(
153153
f"Aspect ratio cannot reduce to any less than {minimum_ratio_str} ({minimum_ratio}), but was {aspect_ratio} ({calculated_ratio})."
154154
)
155-
elif calculated_ratio > maximum_ratio:
155+
if calculated_ratio > maximum_ratio:
156156
raise TypeError(
157157
f"Aspect ratio cannot reduce to any greater than {maximum_ratio_str} ({maximum_ratio}), but was {aspect_ratio} ({calculated_ratio})."
158158
)

comfy_api_nodes/nodes_moonvalley.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ async def execute(
473473
height=width_height["height"],
474474
use_negative_prompts=True,
475475
)
476-
"""Upload image to comfy backend to have a URL available for further processing"""
476+
477477
# Get MIME type from tensor - assuming PNG format for image tensors
478478
mime_type = "image/png"
479479

@@ -591,7 +591,6 @@ async def execute(
591591
validated_video = validate_video_to_video_input(video)
592592
video_url = await upload_video_to_comfyapi(validated_video, auth_kwargs=auth)
593593

594-
"""Validate prompts and inference input"""
595594
validate_prompts(prompt, negative_prompt)
596595

597596
# Only include motion_intensity for Motion Transfer

comfy_api_nodes/nodes_recraft.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def handle_converted_lists(data, parent_key, lists_to_check=tuple[list]):
107107
# if list already exists exists, just extend list with data
108108
for check_list in lists_to_check:
109109
for conv_tuple in check_list:
110-
if conv_tuple[0] == parent_key and type(conv_tuple[1]) is list:
110+
if conv_tuple[0] == parent_key and isinstance(conv_tuple[1], list):
111111
conv_tuple[1].append(formatter(data))
112112
return True
113113
return False
@@ -119,7 +119,7 @@ def handle_converted_lists(data, parent_key, lists_to_check=tuple[list]):
119119
if formatter is None:
120120
formatter = lambda v: v # Multipart representation of value
121121

122-
if type(data) is not dict:
122+
if not isinstance(data, dict):
123123
# if list already exists exists, just extend list with data
124124
added = handle_converted_lists(data, parent_key, converted_to_check)
125125
if added:
@@ -136,9 +136,9 @@ def handle_converted_lists(data, parent_key, lists_to_check=tuple[list]):
136136

137137
for key, value in data.items():
138138
current_key = key if parent_key is None else f"{parent_key}[{key}]"
139-
if type(value) is dict:
139+
if isinstance(value, dict):
140140
converted.extend(recraft_multipart_parser(value, current_key, formatter, next_check).items())
141-
elif type(value) is list:
141+
elif isinstance(value, list):
142142
for ind, list_value in enumerate(value):
143143
iter_key = f"{current_key}[]"
144144
converted.extend(recraft_multipart_parser(list_value, iter_key, formatter, next_check, is_list=True).items())

pyproject.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,14 @@ messages_control.disable = [
5757
"redefined-builtin",
5858
"unnecessary-lambda",
5959
"dangerous-default-value",
60+
"invalid-overridden-method",
6061
# next warnings should be fixed in future
6162
"bad-classmethod-argument", # Class method should have 'cls' as first argument
6263
"wrong-import-order", # Standard imports should be placed before third party imports
6364
"logging-fstring-interpolation", # Use lazy % formatting in logging functions
6465
"ungrouped-imports",
6566
"unnecessary-pass",
66-
"unidiomatic-typecheck",
6767
"unnecessary-lambda-assignment",
6868
"no-else-return",
69-
"no-else-raise",
70-
"invalid-overridden-method",
7169
"unused-variable",
72-
"pointless-string-statement",
73-
"redefined-outer-name",
7470
]

0 commit comments

Comments
 (0)