-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[bugfix] Find files with ./ as input with a __init__.py file #9211
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #9211 +/- ##
==========================================
+ Coverage 95.79% 95.81% +0.01%
==========================================
Files 173 173
Lines 18714 18762 +48
==========================================
+ Hits 17927 17976 +49
+ Misses 787 786 -1
|
for more information, see https://pre-commit.ci
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Hi @Pierre-Sassoulas , anything I can do to improve this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for not being very reactive on this one. MR that modify file discovery are really hard to review and can lead to issues with namespace package or the like so I'm very afraid to accept them 😄 This however LGTM because the only change is easy to understand os.path.dirname("__init__.py") == ""
and everything else is doc or test (I did not realize that when skimming). Great MR !
Co-authored-by: Pierre Sassoulas <[email protected]>
This comment has been minimized.
This comment has been minimized.
doc/whatsnew/fragments/9210.bugfix
Outdated
Fix bug for not being able to walk through files when work on `./` as input | ||
at a directory with a `__init__.py` file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sentence is not really understandable. I'd like to suggest something to improve but I don't even really know what it is meant to say.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I'm not English native. What I mean here is that:
- It's a bug fix
- The current situation is that, if there is a
__init__.py
file in a directory, pylint is not able to walk (iteratre through) the files in this directory
Co-authored-by: Daniël van Noord <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
🤖 According to the primer, this change has no effect on the checked open source code. 🤖🎉 This comment was generated for commit d804da2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Than kyou for reviewing @DanielNoord ! Merging because the warning in readthedoc is unrelated and fixed on the main branch.
Co-authored-by: Pierre Sassoulas <[email protected]> Co-authored-by: Daniël van Noord <[email protected]> (cherry picked from commit abdb874)
Congratulation on becoming a pylint contributor @CareF :) |
…h a __init__.py file (#9286) * [bugfix] Find files with ./ as input with a __init__.py file (#9211) Co-authored-by: Pierre Sassoulas <[email protected]> Co-authored-by: Daniël van Noord <[email protected]> (cherry picked from commit abdb874)
Type of Changes
Description
When working as
pylint --recursive=y ./
orpylint --recursive=y .
on a directory with a__init__.py
file, pylilnt will not be able to walk through other files due to an empty input formodutils.get_module_files
becauseos.path.dirname("__init__.py") == ""
. This PR tries to fix this behavior.Closes #9210