Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
dkrupp committed Oct 26, 2023
1 parent bda8d01 commit 74a295e
Showing 1 changed file with 10 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,21 +148,18 @@ def _parse_fixits(
while self.message_line_re.match(line) is None and \
self.note_line_re.match(line) is None:
match = self.fixit_new_re.match(line)
old_format = False
if not match:
match = self.fixit_old_re.match(line)
old_format = True
message_text = match.group("message")
if message_text != '':
if old_format:
# Until clang-tidy 16 the fixit
# line starts with white spaces
col = line.find(message_text) + 1
else:
# In later versions we have white spaces the
# optionally a line number and then a | character
col = line.find(message_text) - line.find("|") - 1
report.bug_path_events.append(BugPathEvent(
message_text = match.group("message")
# Until Clang 16, the FixIt line starts with whitespace.
col = line.find(message_text) + 1
else:
message_text = match.group("message")
# In newer versions, we have whitespace then, optionally
# a line number, and then a | character.
col = line.find(message_text) - line.find("|") - 1

report.bug_path_events.append(BugPathEvent(
f"{message_text} (fixit)",
report.file,
report.line,
Expand Down

0 comments on commit 74a295e

Please sign in to comment.