Skip to content

Fix Invalid no-name-in-module when shadowing a base module with an alias then calling a method named format on that alias. #10409

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

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

Conversation

pavan-msys
Copy link
Contributor

Type of Changes

Type
🐛 Bug fix

Description

This PR fixes an issue where Pylint incorrectly raises no-name-in-module (E0611) errors for valid Python code using shadowed imports (e.g., import my_module.utils as my_module).

Closes #10193

Copy link

codecov bot commented May 29, 2025

Codecov Report

Attention: Patch coverage is 45.45455% with 6 lines in your changes missing coverage. Please review.

Project coverage is 95.88%. Comparing base (d69d13a) to head (e6cf8e7).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pylint/checkers/variables.py 45.45% 6 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #10409      +/-   ##
==========================================
- Coverage   95.90%   95.88%   -0.03%     
==========================================
  Files         176      176              
  Lines       19139    19157      +18     
==========================================
+ Hits        18356    18368      +12     
- Misses        783      789       +6     
Files with missing lines Coverage Δ
pylint/checkers/variables.py 96.89% <45.45%> (-0.40%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This comment has been minimized.

This comment has been minimized.

@pavan-msys pavan-msys marked this pull request as draft May 29, 2025 06:41
Copy link
Contributor

🤖 According to the primer, this change has no effect on the checked open source code. 🤖🎉

This comment was generated for commit e6cf8e7

Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

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

Thank you for working on this @pavan-msys

@@ -0,0 +1,90 @@
# pylint: disable=missing-docstring,consider-using-with,trailing-whitespace,unused-import
Copy link
Member

Choose a reason for hiding this comment

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

This seems to be a unit test class that is erroneously in the functional test directory. Functional test are raw examples of code, unit test should be elsewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid no-name-in-module when shadowing a base module with an alias then calling a method named format on that alias
2 participants