Skip to content

Commit

Permalink
Merge pull request #1061 from cyw3/main
Browse files Browse the repository at this point in the history
luacheck: fix msg
  • Loading branch information
yql70 authored Apr 18, 2024
2 parents fccbd09 + 6c0b6d7 commit 0471bc5
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)[3]
# msg中 on line 后面也会跟着行号
msg = msg.split("on line ")[0].strip()
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 0471bc5

Please sign in to comment.