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: Avoid false negatives for TC001-003 related to typing.cast. #199

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

Daverball
Copy link
Collaborator

Closes: #127

We could be more aggressive and like with annotations treat even unquoted casts as forward references for the purposes of TC001-003. But I'm not sure it's the right call. Going the other way and recording them as uses seems bad too, due to the conflicting TC004/TC006 errors that will create, so the status quo should be fine for now.

If we can properly handle forward references that's already a huge win.

Copy link

codecov bot commented Dec 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.8%. Comparing base (7621d51) to head (a6361ea).
Report is 90 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##            main    #199     +/-   ##
=======================================
- Coverage   98.7%   96.8%   -2.0%     
=======================================
  Files          3       3             
  Lines        482     985    +503     
=======================================
+ Hits         476     954    +478     
- Misses         6      31     +25     
Files with missing lines Coverage Δ
flake8_type_checking/checker.py 96.6% <100.0%> (-2.0%) ⬇️

... and 1 file with indirect coverage changes

@Daverball Daverball requested a review from sondrelg December 13, 2024 12:01
Copy link
Member

@sondrelg sondrelg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree. This seems most sane 👌

@Daverball Daverball merged commit 87543b7 into snok:main Dec 13, 2024
6 of 7 checks passed
@Daverball Daverball deleted the fix/cast-forward-reference branch December 13, 2024 12:20
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.

Type-checking block errors not reported for imports used in cast() string annotation
2 participants