Skip to content
This repository was archived by the owner on Aug 7, 2023. It is now read-only.

Commit 8bf7948

Browse files
committed
finish puppet-lint json output parsing functionality
1 parent 69fdcd2 commit 8bf7948

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/main.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,14 @@ export default {
8080
}
8181
const toReturn = [];
8282

83-
// Parse JSON output
84-
const info = JSON.parse(output);
83+
// Parse JSON output and immediately access zeroth element of redundant outer array
84+
const info = JSON.parse(output)[0];
8585

8686
// Check for proper warnings and errors from stdout
8787
if (info.length > 0) {
88-
info[0][0].forEach(function (issue) {
88+
info.forEach(function (issue) {
8989
toReturn.push({
90-
severity: issue.KIND,
90+
severity: issue.kind,
9191
excerpt: issue.message,
9292
location: {
9393
file: issue.path,

0 commit comments

Comments
 (0)