[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2026-07-09 15:19:01 +00:00
parent 9dc34ac0b3
commit bf71d41595

View file

@ -898,8 +898,13 @@ def _mapping_first_keys(value: ast.AST) -> set[str]:
if isinstance(value, ast.Dict):
nodes = value.keys
elif isinstance(value, ast.Call):
nodes = [el.elts[0] for a in value.args if isinstance(a, (ast.List, ast.Tuple))
for el in a.elts if isinstance(el, (ast.Tuple, ast.List)) and el.elts]
nodes = [
el.elts[0]
for a in value.args
if isinstance(a, (ast.List, ast.Tuple))
for el in a.elts
if isinstance(el, (ast.Tuple, ast.List)) and el.elts
]
else:
nodes = []
return {n.value for n in nodes if isinstance(n, ast.Constant) and isinstance(n.value, str)}
@ -918,7 +923,7 @@ def _config_model_types(tier: str) -> frozenset[str]:
if not _safe_is_file(path):
continue
try:
tree = ast.parse(path.read_text(encoding="utf-8"))
tree = ast.parse(path.read_text(encoding = "utf-8"))
except Exception:
continue
for node in ast.walk(tree):