mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-25 05:52:34 +00:00
chore: ruff auto-fix PLR6201 — tuple → set in membership tests (#23937)
Replace with for all literal-tuple membership tests. Set lookup is O(1) vs O(n) for tuple — consistent micro-optimization across the codebase. 608 instances fixed via `ruff --fix --unsafe-fixes`, 0 remaining. 133 files, +626/-626 (net zero).
This commit is contained in:
parent
8c11710314
commit
2ec8d2b42f
133 changed files with 626 additions and 626 deletions
|
|
@ -101,7 +101,7 @@ def _normalize_bundle_path(path_value: str, *, field_name: str, allow_nested: bo
|
|||
|
||||
normalized = raw.replace("\\", "/")
|
||||
path = PurePosixPath(normalized)
|
||||
parts = [part for part in path.parts if part not in ("", ".")]
|
||||
parts = [part for part in path.parts if part not in {"", "."}]
|
||||
|
||||
if normalized.startswith("/") or path.is_absolute():
|
||||
raise ValueError(f"Unsafe {field_name}: {path_value}")
|
||||
|
|
@ -1415,7 +1415,7 @@ class SkillsShSource(SkillSource):
|
|||
dir_name = entry["name"]
|
||||
if dir_name.startswith((".", "_")):
|
||||
continue
|
||||
if dir_name in ("skills", ".agents", ".claude"):
|
||||
if dir_name in {"skills", ".agents", ".claude"}:
|
||||
continue # already tried
|
||||
# Try direct: repo/dir/skill_token
|
||||
direct_id = f"{repo}/{dir_name}/{skill_token}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue