Skip to content

Commit

Permalink
🐛 luacheck-移除msg中的行列号信息
Browse files Browse the repository at this point in the history
Signed-off-by: cyw3 <2927096163@qq.com>
  • Loading branch information
cyw3 committed Apr 18, 2024
1 parent 402047c commit 0a4e98d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions client/tool/luacheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,15 @@ def run_luacheck(self, scan_cmd, error_output, pos, rules):
rule = error.attrib.get("type")
if rules and rule not in rules:
continue
msg = error.attrib.get("message")[pos:]
line = int(msg.split(":")[1])
column = int(msg.split(":")[2])
# 2024/4/18 移除msg中的行列号信息
message = error.attrib.get("message")
if message is None:
continue
msg = message.split(":")[3]
# msg中 on line 后面也会跟着行号
msg = msg.split("on line ")[0]
line = int(message.split(":")[1])
column = int(message.split(":")[2])
issues.append({"path": path, "rule": rule, "msg": msg, "line": line, "column": column})
return issues

Expand Down

0 comments on commit 0a4e98d

Please sign in to comment.