Skip to content

Commit

Permalink
skip e501 fixed method for f-string line(s)
Browse files Browse the repository at this point in the history
  • Loading branch information
hhatto committed May 29, 2024
1 parent 6878c96 commit b4c586d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion autopep8.py
Original file line number Diff line number Diff line change
Expand Up @@ -3376,13 +3376,20 @@ def multiline_string_lines(source, include_docstrings=False):
"""
line_numbers = set()
previous_token_type = ''
_check_target_tokens = [tokenize.STRING]
if IS_SUPPORT_TOKEN_FSTRING:
_check_target_tokens.extend([

Check warning on line 3381 in autopep8.py

View check run for this annotation

Codecov / codecov/patch

autopep8.py#L3381

Added line #L3381 was not covered by tests
tokenize.FSTRING_START,
tokenize.FSTRING_MIDDLE,
tokenize.FSTRING_END,
])
try:
for t in generate_tokens(source):
token_type = t[0]
start_row = t[2][0]
end_row = t[3][0]

if token_type == tokenize.STRING and start_row != end_row:
if token_type in _check_target_tokens and start_row != end_row:
if (
include_docstrings or
previous_token_type != tokenize.INDENT
Expand Down

0 comments on commit b4c586d

Please sign in to comment.