use the actual line contents when processing physical lines

This commit is contained in:
Anthony Sottile 2022-01-22 15:17:10 -05:00
parent f5260d1464
commit 23a60dd902
4 changed files with 57 additions and 21 deletions

View file

@ -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:

View file

@ -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(