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

Closed
wants to merge 12 commits into 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

@pavan-msys pavan-msys force-pushed the 10193-issue branch 2 times, most recently from faac884 to 3985150 Compare May 29, 2025 05:43
Copy link

codecov bot commented May 29, 2025

Codecov Report

Attention: Patch coverage is 90.90909% with 1 line in your changes missing coverage. Please review.

Project coverage is 95.90%. Comparing base (25a0f9e) to head (c50055c).

Files with missing lines Patch % Lines
pylint/checkers/variables.py 90.90% 1 Missing ⚠️

❌ Your patch check has failed because the patch coverage (90.90%) is below the target coverage (100.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #10409      +/-   ##
==========================================
- Coverage   95.91%   95.90%   -0.01%     
==========================================
  Files         176      176              
  Lines       19147    19157      +10     
==========================================
+ Hits        18364    18373       +9     
- Misses        783      784       +1     
Files with missing lines Coverage Ξ”
pylint/checkers/variables.py 97.24% <90.90%> (-0.06%) ⬇️
πŸš€ 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

This comment has been minimized.

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.

This comment has been minimized.

@pavan-msys pavan-msys closed this Jun 2, 2025
Copy link
Contributor

github-actions bot commented Jun 2, 2025

πŸ€– According to the primer, this change has no effect on the checked open source code. πŸ€–πŸŽ‰

This comment was generated for commit d676e52

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