fix: add PL rule

This commit is contained in:
Dowon
2024-08-24 13:58:08 +09:00
parent 652da215ac
commit fbbe127c9e
7 changed files with 8 additions and 7 deletions

View File

@@ -133,7 +133,7 @@ def get_table(title: str, data: dict[str, Any]) -> Table:
table.add_column("Value")
for key, value in data.items():
if not isinstance(value, str):
value = repr(value)
value = repr(value) # noqa: PLW2901
table.add_row(key, value)
return table

View File

@@ -369,7 +369,7 @@ def mask_preprocessing(w: Widgets, n: int, is_img2img: bool):
)
def inpainting(w: Widgets, n: int, is_img2img: bool, webui_info: WebuiInfo):
def inpainting(w: Widgets, n: int, is_img2img: bool, webui_info: WebuiInfo): # noqa: PLR0915
eid = partial(elem_id, n=n, is_img2img=is_img2img)
with gr.Group():

View File

@@ -163,7 +163,7 @@ def create_bbox_from_mask(
"""
bboxes = []
for mask in masks:
mask = mask.resize(shape)
mask = mask.resize(shape) # noqa: PLW2901
bbox = mask.getbbox()
if bbox is not None:
bboxes.append(list(bbox))

View File

@@ -49,7 +49,7 @@ class ControlNetExt:
models = self.external_cn.get_models()
self.cn_models.extend(m for m in models if cn_model_regex.search(m))
def update_scripts_args(
def update_scripts_args( # noqa: PLR0913
self,
p,
model: str,

View File

@@ -45,7 +45,7 @@ class ControlNetExt:
def init_controlnet(self):
self.cn_available = True
def update_scripts_args(
def update_scripts_args( # noqa: PLR0913
self,
p,
model: str,

View File

@@ -56,6 +56,7 @@ select = [
"N",
"PD",
"PERF",
"PL",
"PIE",
"PT",
"PTH",
@@ -67,7 +68,7 @@ select = [
"UP",
"W",
]
ignore = ["B905", "E501"]
ignore = ["B905", "E501", "PLR2004", "PLW0603"]
unfixable = ["F401"]
[tool.ruff.lint.isort]

View File

@@ -745,7 +745,7 @@ class AfterDetailerScript(scripts.Script):
return optimal_resolution
def fix_p2(
def fix_p2( # noqa: PLR0913
self, p, p2, pp: PPImage, args: ADetailerArgs, pred: PredictOutput, j: int
):
seed, subseed = self.get_seed(p)