afonasev / flake8-return

Flake8 plugin for return expressions checking.
MIT License
62 stars 69 forks source link

Fix/47/Update-R504-for-assignment-value #117

Closed calumy closed 2 years ago

calumy commented 2 years ago

This PR updates the visit_Assign function to get refs for the assignment value. This fixes a couple of the issues that can be found in #47, b0109af5fe27986d5372a54a2cfd43d1fff97efd. All other issues can be refactored to get R504 to pass (see 47c5b3c64c832acc9ba679fe50ab1b12b5df821b).

As @ericbn, notes, this rule could be considered controversial, so it could potentially be updated to be optional in another issue/pr.

Fixes #47.

afonasev commented 2 years ago

Thx for contribute! Can you fix https://github.com/afonasev/flake8-return/actions/runs/3041122888/jobs/4900937759?

calumy commented 2 years ago

@afonasev, I have updated the linting errors and fixed some other issues identified in the actions. This can be seen here.

Please let me know if you require any other updates.

codecov[bot] commented 2 years ago

Codecov Report

Merging #117 (f2e99d9) into master (3bba9cd) will increase coverage by 1.24%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #117      +/-   ##
==========================================
+ Coverage   94.04%   95.29%   +1.24%     
==========================================
  Files           3        3              
  Lines         168      170       +2     
  Branches       35       45      +10     
==========================================
+ Hits          158      162       +4     
+ Misses          5        4       -1     
+ Partials        5        4       -1     
Impacted Files Coverage Δ
flake8_return/errors.py 100.00% <100.00%> (ø)
flake8_return/visitors.py 94.70% <100.00%> (+1.41%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.