File tree Expand file tree Collapse file tree 3 files changed +4
-7
lines changed
Expand file tree Collapse file tree 3 files changed +4
-7
lines changed Original file line number Diff line number Diff line change 2020# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
2121# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2222"""Removes unused imports and unused variables as reported by pyflakes."""
23-
2423from __future__ import annotations
2524
2625import ast
@@ -576,7 +575,8 @@ def filter_code(
576575 undefined_names : list [str ] = []
577576 if expand_star_imports and not (
578577 # See explanations in #18.
579- re .search (r"\b__all__\b" , source ) or re .search (r"\bdel\b" , source )
578+ re .search (r"\b__all__\b" , source )
579+ or re .search (r"\bdel\b" , source )
580580 ):
581581 marked_star_import_line_numbers = frozenset (
582582 star_import_used_line_numbers (messages ),
@@ -1515,9 +1515,8 @@ def _main(
15151515 if not success :
15161516 return 1
15171517
1518- if (
1519- args ["remove_rhs_for_unused_variables" ]
1520- and not (args ["remove_unused_variables" ])
1518+ if args ["remove_rhs_for_unused_variables" ] and not (
1519+ args ["remove_unused_variables" ]
15211520 ):
15221521 _LOGGER .error (
15231522 "Using --remove-rhs-for-unused-variables only makes sense when "
Original file line number Diff line number Diff line change 11#!/usr/bin/env python
22"""Test suite for autoflake."""
3-
43from __future__ import annotations
54
65import contextlib
Original file line number Diff line number Diff line change 55done by doing a syntax check after the autoflake run. The number of
66Pyflakes warnings is also confirmed to always improve.
77"""
8-
98from __future__ import annotations
109
1110import argparse
You can’t perform that action at this time.
0 commit comments