Skip to content

v1.13.0

Choose a tag to compare

@kratos0718 kratos0718 released this 20 Sep 09:34
· 23 commits to main since this release

What's new

10 new checks (CH051-CH060), bringing the total to 60:

  • CH051 mutation-during-iteration - mutating a dict/list/set while a loop iterates directly over it
  • CH052 forwarded-without-unpacking - a function's own *args/**kwargs forwarded to a call without the unpacking star
  • CH053 aliased-list-multiplication - [mutable_literal] * n repeats one object reference, not n independent copies
  • CH054 slots-blocks-dict - a __slots__ class that still reaches for self.__dict__ or @cached_property
  • CH055 duplicate-with-target - the same as name bound twice in one with statement
  • CH056 path-absolute-literal-join - joining a Path with a literal that starts with / resets to absolute
  • CH057 reused-exhausted-iterator - replaying an already-consumed generator/map/filter/zip
  • CH058 argparse-store-true-default - an argparse flag defaultd to its own effect, making it a no-op
  • CH059 decorator-missing-return - a @functools.wraps-wrapped inner function never referenced again
  • CH060 falsy-and-or-ternary - the broken pre-ternary and/or idiom when the middle value is falsy

Every check was verified directly (REPL reproduction) before any AST code was written, then corpus-scanned against ~29 real frameworks. Several needed real precision passes - see docs/FINDINGS.md for the full story, including a first-pass false-positive count over 2,000 on one check, cut to 2 real hits after narrowing.

Also: 4 real, unfiled bugs found in mlflow, litellm, and transformers (CH051 x3, CH058 x2) - see FINDINGS.md's "Real bugs found, not yet filed."

47 new tests (384 total), self-scan clean, fresh clean-venv wheel install verified.