jendrikseipp / vulture

Find dead Python code
MIT License
3.45k stars 152 forks source link

Fix false positives in typing.Protocol #313

Open pm3512 opened 1 year ago

pm3512 commented 1 year ago

Description

Adds the ast_scope package and uses scoping information to find functions in subclasses of typing.Protocol and mark them and their arguments as used.

Related Issue

Resolves #309

Checklist:

codecov-commenter commented 1 year ago

Codecov Report

Merging #313 (d6c182e) into main (e2e84d0) will increase coverage by 0.03%. The diff coverage is 100.00%.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##             main     #313      +/-   ##
==========================================
+ Coverage   98.94%   98.98%   +0.03%     
==========================================
  Files          21       21              
  Lines         665      690      +25     
==========================================
+ Hits          658      683      +25     
  Misses          7        7              
Impacted Files Coverage Δ
vulture/core.py 98.63% <100.00%> (+0.10%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

btschroer commented 1 week ago

Nice 👍