[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-05-19 12:02:06 +00:00
commit f2809221d4

View file

@ -291,7 +291,7 @@ def _expand_brace_projections(text: str, limit: int = 64) -> set[str]:
brace = _BRACE_EXPANSION_RE.search(cur)
if brace:
for alt in brace.group(1).split(","):
nxt = cur[: brace.start()] + alt + cur[brace.end():]
nxt = cur[: brace.start()] + alt + cur[brace.end() :]
if nxt not in out:
out.add(nxt)
queue.append(nxt)
@ -303,7 +303,7 @@ def _expand_brace_projections(text: str, limit: int = 64) -> set[str]:
for ch in klass.group(1):
if ch == "-":
continue
nxt = cur[: klass.start()] + ch + cur[klass.end():]
nxt = cur[: klass.start()] + ch + cur[klass.end() :]
if nxt not in out:
out.add(nxt)
queue.append(nxt)
@ -1258,9 +1258,8 @@ def _check_signal_escape_patterns(code: str):
parts.append(s)
return _join_path_parts(parts)
ctor_fq = _fq_chain_name(node.func)
is_path_ctor = (
ctor_fq in path_aliases
or any(ctor_fq == f"{alias}.Path" for alias in pathlib_aliases)
is_path_ctor = ctor_fq in path_aliases or any(
ctor_fq == f"{alias}.Path" for alias in pathlib_aliases
)
if is_path_ctor and node.args:
parts = []
@ -2197,10 +2196,7 @@ def _check_signal_escape_patterns(code: str):
)
# Direct sock.connect((host, port)) bypasses the FQ-prefix branch below.
if (
isinstance(node.func, ast.Attribute)
and node.func.attr == "connect"
):
if isinstance(node.func, ast.Attribute) and node.func.attr == "connect":
# Use the static-string resolver so a concatenated /
# f-string host literal (e.g. ``'169.254.' + '169.254'``)
# is recognised the same as a bare ast.Constant.