Skip to content

Commit f24eef4

Browse files
committed
Add function to format the usable warnings after analysis
1 parent acef49b commit f24eef4

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

linter.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,20 @@ def canonical_error(self, issue):
102102
}
103103
}
104104

105+
def formalize(self, issues):
106+
lines = []
107+
for issue in issues:
108+
lines.append(
109+
"{}:{}:{}:{}:{}".format(
110+
issue["Pos"]["Shortname"],
111+
issue["Pos"]["Line"],
112+
issue["Pos"]["Column"],
113+
issue["Level"],
114+
issue["Text"]
115+
)
116+
)
117+
return "\n".join(lines)
118+
105119
def execute(self, cmd):
106120
lines = []
107121
output = self.communicate(cmd)

0 commit comments

Comments
 (0)