Skip to content

Commit

Permalink
plugins/clippy: propagate column number in scan results
Browse files Browse the repository at this point in the history
  • Loading branch information
pmatouse authored and kdudka committed Apr 9, 2024
1 parent d5a0003 commit 3d8001a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/convert-clippy.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import sys
import re

MESSAGE_PATTERN = r"^(.*?): (.*?)\s+-->\s+(.*?):(\d+):\d+(.*)"
MESSAGE_PATTERN = r"^(.*?): (.*?)\s+-->\s+(.*?):(\d+):(\d+)(.*)"
# we extract package path from the package_id
# eg -- "package_id":"stratisd 3.6.5 (path+file:///builddir/build/BUILD/stratisd-3.6.5)
PACKAGE_ID_PATTERN = r"path\+file://(.*)\)"
Expand Down Expand Up @@ -37,10 +37,10 @@ def main():
if not match:
continue

message_type, message_content, file_path, line_number, rest = match.groups()
message_type, message_content, file_path, line_number, column, rest = match.groups()

print("Error: CLIPPY_WARNING:")
print(f"{package_path}/{file_path}:{line_number}: {message_type}: {message_content}")
print(f"{package_path}/{file_path}:{line_number}:{column}: {message_type}: {message_content}")
for x, line in enumerate(rest.split("\n")):
if x == 0 and line.strip() == "":
continue
Expand Down

0 comments on commit 3d8001a

Please sign in to comment.