Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(visitor): skip type checking blocks without future annotations #662

Conversation

mkniewallner
Copy link
Collaborator

@mkniewallner mkniewallner commented Apr 5, 2024

Resolves #661.

PR Checklist

  • A description of the changes is added to the description of this PR.
  • If there is a related issue, make sure it is linked to this PR.
  • If you've fixed a bug or added code that should be tested, add tests!
  • If you've added or modified a feature, documentation in docs is updated

Description of changes

Implementation in #652 was a bit too defensive, for invalid reasons. from __future__ import annotations is not relevant in the context of deptry, as not using it will still allows setting types but in quotes. So we should also skip those imports when a module does not use from __future__ import annotations.

Copy link

codecov bot commented Apr 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.4%. Comparing base (36a06f0) to head (9008c76).

Additional details and impacted files
@@          Coverage Diff          @@
##            main    #662   +/-   ##
=====================================
  Coverage   92.4%   92.4%           
=====================================
  Files         35      35           
  Lines        958     958           
  Branches     176     176           
=====================================
  Hits         886     886           
  Misses        55      55           
  Partials      17      17           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mkniewallner mkniewallner marked this pull request as ready for review April 5, 2024 18:24
@fpgmaas fpgmaas merged commit 1fa8170 into fpgmaas:main Apr 5, 2024
20 checks passed
@mkniewallner mkniewallner deleted the fix/skip-type-checking-blocks-without-future-annotations branch April 5, 2024 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ignore 'TYPE_CHECKING' imports if string annotation is used
2 participants