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

Resolve used-before-assignment false negative when a function is defined under TYPE_CHECKING #10034

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

zenlyj
Copy link
Contributor

@zenlyj zenlyj commented Oct 19, 2024

Type of Changes

Type
βœ“ πŸ› Bug fix
✨ New feature
πŸ”¨ Refactoring
πŸ“œ Docs

Description

Raise used-before-assignment when a function is defined under TYPE_CHECKING and used later.

Refs #10028

@zenlyj zenlyj marked this pull request as draft October 19, 2024 07:20
Copy link

codecov bot commented Oct 19, 2024

Codecov Report

All modified and coverable lines are covered by tests βœ…

Project coverage is 95.80%. Comparing base (5feface) to head (a20eb06).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #10034   +/-   ##
=======================================
  Coverage   95.80%   95.80%           
=======================================
  Files         174      174           
  Lines       18935    18949   +14     
=======================================
+ Hits        18141    18155   +14     
  Misses        794      794           
Files with missing lines Coverage Ξ”
pylint/checkers/variables.py 97.23% <100.00%> (+0.02%) ⬆️

This comment has been minimized.

This comment has been minimized.

Copy link
Contributor

πŸ€– Effect of this PR on checked open source code: πŸ€–

Effect on home-assistant:
The following messages are now emitted:

  1. possibly-used-before-assignment:
    Possibly using variable 'touch_event_callback' before assignment
    https://github.com/home-assistant/core/blob/9d0701a62b63d95abac9c5da36039f18ed0bd8c7/homeassistant/components/nanoleaf/__init__.py#L77

This comment was generated for commit a20eb06

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.

2 participants