Repository navigation
v0.22.2 - Quick fixes for .count() > 0 no longer produce broken code
Quick fixes for .count() > 0 no longer produce broken code.
Fixed
-
DOL006 no longer marks snapshot removal safe to apply
(#313). The VS Code rule
skips dictionary views such ascache.keys()and offers a manual suggestion
for possible QuerySets. -
VS Code rules DOL001-DOL004 skip a match that is an operand of an operator
(#293).
Inif event.capacity - event.registrations.count() > 0:Python tests the
whole difference, so the safe fixevent.capacity - event.registrations.exists()
made a full event look open, and DOL002's rewrite
event.capacity - not event.registrations.exists()was a SyntaxError. Matches after an arithmetic, bitwise or comparison operator are
now left alone; assignment and augmented assignment still get the finding. -
VS Code rules DOL001-DOL004 skip a match that continues on its right
(#296).
if qs.count() > 0.5:was rewritten toqs.exists().5(a SyntaxError), and
> 0 + offsetor== 0 == otherchanged meaning. A match followed by a
fraction, an arithmetic or bitwise operator, another comparison,isorin
is now left alone.