-
-
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
Add --allow-reexport-from-package
option
#8124
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #8124 +/- ##
=======================================
Coverage 95.53% 95.53%
=======================================
Files 177 177
Lines 18600 18604 +4
=======================================
+ Hits 17769 17773 +4
Misses 831 831
|
This comment has been minimized.
This comment has been minimized.
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.
Should we add a functional tests for this ? (We might need to unfilter __init.py
).
I think the option make sense, the reason we did not do it at first is the time to implement / value ratio imo. Now that the work is done there's no reason not to do it.
pylint/checkers/imports.py
Outdated
if len(splitted_packages) == 1 and ( | ||
self._allow_reexport_package is False | ||
or self._current_module_package is False | ||
): | ||
self.add_message("useless-import-alias", node=node) |
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.
Let's add the high confidence while we're at it.
Should we include it in |
Let's add to 2.16.0, we did a beta release not a blood contract swearing to feature freeze :D |
🤖 According to the primer, this change has no effect on the checked open source code. 🤖🎉 This comment was generated for commit 3925e73 |
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.
Nice !
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-maintenance/2.16.x maintenance/2.16.x
# Navigate to the new working tree
cd .worktrees/backport-maintenance/2.16.x
# Create a new branch
git switch --create backport-8124-to-maintenance/2.16.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 acb28d8fcefb06179d9e6528ba14dd099e12ecfa
# Push it to GitHub
git push --set-upstream origin backport-8124-to-maintenance/2.16.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-maintenance/2.16.x Then, create a pull request where the |
No need to backport we're going to release 2.16.0 soon. |
👍🏻 Thought we had a maintenance branch for |
That's my bad I created the label way too early. |
Depends. If the goal was a feature lock and only allow bugfixes, it would have been the right approach. |
We could do that if we introduce RC versions but tbh i think we juste need to release at this point |
👍🏻 Works for me! Just didn't know what you had in mind 😄 |
Description
Add option to reduce amount of false-positives for
useless-import-alias
when choosing to use explicit reexports.Test might be a bit difficult as the result depends on the filename (if it's__init__.py
). Not sure it's worth it.Closes #6006