Tadaboody / good_smell

A linting/refactoring library for python best practices and lesser-known tricks
BSD 3-Clause "New" or "Revised" License
30 stars 3 forks source link

YieldFrom Smell #58

Closed AdamGold closed 5 years ago

AdamGold commented 5 years ago

add YieldFrom smell - replace for x in iterable yield x in yield from iterable

Provide links to any relevant tickets, articles or other resources

Closes: #51 Progresses : #

codecov[bot] commented 5 years ago

Codecov Report

Merging #58 into master will increase coverage by 0.4%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master      #58     +/-   ##
=========================================
+ Coverage   94.17%   94.58%   +0.4%     
=========================================
  Files           9       10      +1     
  Lines         189      203     +14     
  Branches       13       13             
=========================================
+ Hits          178      192     +14     
  Misses         11       11
Impacted Files Coverage Δ
good_smell/smells/yield_from.py 100% <100%> (ø)
good_smell/smells/__init__.py 100% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 0870629...d66482b. Read the comment docs.

AdamGold commented 5 years ago
Tadaboody commented 5 years ago

I don't think checking the parents would be possible because there isn't a pointer to them. Maybe subclassing the ast to add them would prove worth it. Would make #7 easier

Tadaboody commented 5 years ago

Where did you rebase to? Dropwhile was implemented in #56 and wasn't merged anywhere

AdamGold commented 5 years ago

Where did you rebase to? Dropwhile was implemented in #56 and wasn't merged anywhere

Fixed

Tadaboody commented 5 years ago

🎉 🎉 Thanks for the contribution 🎉 🎉 Ship it