Skip to content

Commit 34a1ccf

Browse files
committed
Add /dev/stderr detection to merge errors with other warnings
1 parent 0413b19 commit 34a1ccf

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

linter.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,22 @@ def execute(self, cmd):
7070
report = json.loads(output)
7171
currnt = os.path.basename(self.filename)
7272

73+
"""merge possible stderr with issues"""
74+
if "Error" in report["Report"]:
75+
for line in report["Report"]["Error"].splitlines():
76+
if line.count(":") < 3:
77+
continue
78+
parts = line.split(":")
79+
report["Issues"].append({
80+
"FromLinter": "typecheck",
81+
"Text": parts[3].strip(),
82+
"Pos": {
83+
"Filename": parts[0],
84+
"Line": parts[1],
85+
"Column": parts[2],
86+
}
87+
})
88+
7389
"""format issues into formal pattern"""
7490
for issue in report["Issues"]:
7591
name = issue["Pos"]["Filename"]

0 commit comments

Comments
 (0)