Skip to content

Commit 4a04238

Browse files
authored
Merge pull request #2 from caarmen/use-rel-path
Use relative path instead of absolute path
2 parents f5c31bc + 006dd29 commit 4a04238

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

pylint_json2checkstyle/checkstyle_reporter.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ def _create_checkstyle_report(messages: List[Message]) -> str:
2020
root = minidom.Document()
2121
checkstyle = root.createElement('checkstyle')
2222
root.appendChild(checkstyle)
23-
messages_by_file = {abspath: list(messages)
24-
for abspath, messages in
23+
messages_by_file = {path: list(messages)
24+
for path, messages in
2525
(groupby(
26-
sorted(messages, key=lambda x: x.abspath),
27-
lambda x: x.abspath)
26+
sorted(messages, key=lambda x: x.path),
27+
lambda x: x.path)
2828
)}
29-
for abspath in messages_by_file:
29+
for path in messages_by_file:
3030
file = root.createElement("file")
31-
file.setAttribute("name", abspath)
32-
for msg in messages_by_file[abspath]:
31+
file.setAttribute("name", path)
32+
for msg in messages_by_file[path]:
3333
error = root.createElement("error")
3434
error.setAttribute("line", str(msg.line))
3535
error.setAttribute("column", str(msg.column))

0 commit comments

Comments
 (0)