Skip to content

Commit 6a38124

Browse files
committed
[PLUTO-1431] add command logs
1 parent 84386e8 commit 6a38124

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

plugins/tools/revive/test/expected.sarif

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@
1212
},
1313
"region": {
1414
"startColumn": 1,
15-
"startLine": 7
15+
"startLine": 1
1616
}
1717
}
1818
}
1919
],
2020
"message": {
21-
"text": "comment on exported function BadFunction should be of the form \"BadFunction ...\""
21+
"text": "should have a package comment"
2222
},
23-
"ruleId": "exported"
23+
"ruleId": "package-comments"
2424
},
2525
{
2626
"locations": [
@@ -31,13 +31,13 @@
3131
},
3232
"region": {
3333
"startColumn": 1,
34-
"startLine": 22
34+
"startLine": 7
3535
}
3636
}
3737
}
3838
],
3939
"message": {
40-
"text": "comment on exported function LongLine should be of the form \"LongLine ...\""
40+
"text": "comment on exported function BadFunction should be of the form \"BadFunction ...\""
4141
},
4242
"ruleId": "exported"
4343
},
@@ -50,13 +50,13 @@
5050
},
5151
"region": {
5252
"startColumn": 1,
53-
"startLine": 27
53+
"startLine": 22
5454
}
5555
}
5656
}
5757
],
5858
"message": {
59-
"text": "comment on exported function NakedReturn should be of the form \"NakedReturn ...\""
59+
"text": "comment on exported function LongLine should be of the form \"LongLine ...\""
6060
},
6161
"ruleId": "exported"
6262
},
@@ -69,15 +69,15 @@
6969
},
7070
"region": {
7171
"startColumn": 1,
72-
"startLine": 1
72+
"startLine": 27
7373
}
7474
}
7575
}
7676
],
7777
"message": {
78-
"text": "should have a package comment"
78+
"text": "comment on exported function NakedReturn should be of the form \"NakedReturn ...\""
7979
},
80-
"ruleId": "package-comments"
80+
"ruleId": "exported"
8181
},
8282
{
8383
"locations": [

tools/revive/reviveRunner.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
package tools
22

33
import (
4+
"codacy/cli-v2/config"
5+
parenttools "codacy/cli-v2/tools"
6+
"codacy/cli-v2/utils/logger"
47
"fmt"
58
"log"
69
"os"
710
"os/exec"
811

9-
"codacy/cli-v2/config"
10-
parenttools "codacy/cli-v2/tools"
12+
"github.com/sirupsen/logrus"
1113
)
1214

1315
// RunRevive executes revive analysis on the specified files or directory
@@ -47,6 +49,10 @@ func RunRevive(workDirectory string, binary string, files []string, outputFile s
4749
cmd.Stdout = os.Stdout
4850
}
4951

52+
logger.Debug("Running Revive command", logrus.Fields{
53+
"command": cmd.String(),
54+
})
55+
5056
if err := cmd.Run(); err != nil {
5157
if _, ok := err.(*exec.ExitError); !ok {
5258
log.Printf("[REVIVE] Error running revive: %v", err)

0 commit comments

Comments
 (0)