The Sourcery CLI now
includes a review
command. Use this to get Sourcery to give suggestions and
comments in addition to standard refactorings. Commented lines will be
highlighted in red.
break-or-continue-outside-loop
refactoring
class-method-first-arg-name
refactoring
collection-to-bool
refactoring
compare-via-equals
suggestion
dict-assign-update-to-union
refactoring
do-no-use-bare-except
suggestion
hoist-repeated-if-condition
refactoring
simplify-single-exception-tuple
refactoring
remove-redundant-boolean
refactoring
remove-redundant-constructor-in-dict-union
refactoring
remove-redundant-exception
refactoring
return-or-yield-outside-function
refactoring
use-getitem-for-re-match-groups
refactoring
use-dictionary-union
refactoring
while-guard-to-condition
refactoring
Add removal of bools to
remove-unnecessary-cast
The remove-duplicate-key refactoring was split into a refactoring
remove-duplicate-set-key
and a suggestion
remove-duplicate-dict-key
remove-duplicate-dict-key
was enhanced to handle unpacked dictionaries
remove-duplicate-dict-key
and
remove-duplicate-set-key
were enhanced to refactor dicts and sets in any context (previously they were
only applied in assignments).
simplify-len-comparison
will now also simplify len(s) < 0 as False and len(s) >= 0 as True
raise-specific-error
will now also cover raising BaseException and raising from other exceptions
Comments will now show on the correct line where there are functions with docstrings. Addresses issue #211
F-strings containing escaped characters will not be refactored into constant strings. Addresses issue #213.
str-prefix-suffix
now triggers in the correct way for applying endswith
use-assigned-var
:
Do not apply if the variable is overwritten in a loop
use-itertools-product
will now combine nested products. Fixes
issue #214.
We now assume any
and all
write to their arguments, since they exhaust
iterators. This fixes
issue #210