Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #321 by handling an F811 import immediately followed by a plain function that replaces the same binding. For example,
from autoflake import fix_codebeforedef fix_code(): ...can now be removed with--remove-all-unused-importsor--imports=autoflake.The new rule requires a single imported name and consecutive statements in a module or function body. It preserves decorators, defaults, annotations, type parameters, class bodies, ambiguous same-line imports, and the
__builtins__/__name__bindings that function creation can read. Existing import-selection, comment, and__init__filters still apply. Adjacency is checked during each filtering pass, including after existing cleanup removes a redundantpass.Validation on Python 3.12 / Windows:
worker_countandsignal.SIGPIPE). Hosted and other Python-version checks have not run locally.