chore: ruff auto-fix C401, C416, C408, PLR1722 (#23940)

C401:   set(x for x in y) -> {x for x in y}      (set comprehension)
C416:   [(k,v) for k,v in d] -> list(d.items())  (unnecessary listcomp)
C408:   tuple()/dict() -> ()/{}                   (unnecessary collection call)
PLR1722: exit() -> sys.exit()                     (adds import sys where needed)

21 instances fixed, 0 remaining. 19 files, +40/-36.
This commit is contained in:
kshitij 2026-05-11 11:20:58 -07:00 committed by GitHub
parent 7b76366552
commit ce0f529cde
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 40 additions and 36 deletions

View file

@ -291,7 +291,7 @@ class MemoryStore:
if len(matches) > 1:
# If all matches are identical (exact duplicates), operate on the first one
unique_texts = set(e for _, e in matches)
unique_texts = {e for _, e in matches}
if len(unique_texts) > 1:
previews = [e[:80] + ("..." if len(e) > 80 else "") for _, e in matches]
return {
@ -341,7 +341,7 @@ class MemoryStore:
if len(matches) > 1:
# If all matches are identical (exact duplicates), remove the first one
unique_texts = set(e for _, e in matches)
unique_texts = {e for _, e in matches}
if len(unique_texts) > 1:
previews = [e[:80] + ("..." if len(e) > 80 else "") for _, e in matches]
return {