mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-05 12:36:54 +00:00
use the actual line contents when processing physical lines
This commit is contained in:
parent
f5260d1464
commit
23a60dd902
4 changed files with 57 additions and 21 deletions
|
|
@ -581,7 +581,7 @@ class FileChecker:
|
|||
line_no = token[2][0]
|
||||
with self.processor.inside_multiline(line_number=line_no):
|
||||
for line in self.processor.split_line(token):
|
||||
self.run_physical_checks(line + "\n")
|
||||
self.run_physical_checks(line)
|
||||
|
||||
|
||||
def _pool_init() -> None:
|
||||
|
|
|
|||
|
|
@ -233,8 +233,10 @@ class FileProcessor:
|
|||
|
||||
This also auto-increments the line number for the caller.
|
||||
"""
|
||||
for line in token[1].split("\n")[:-1]:
|
||||
yield line
|
||||
# intentionally don't include the last line, that line will be
|
||||
# terminated later by a future end-of-line
|
||||
for line_no in range(token.start[0], token.end[0]):
|
||||
yield self.lines[line_no - 1]
|
||||
self.line_number += 1
|
||||
|
||||
def keyword_arguments_for(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue