@@ -7,11 +7,12 @@ import (
77 "codacy/cli-v2/domain"
88 "codacy/cli-v2/tools"
99 "codacy/cli-v2/utils/logger"
10- "github.com/sirupsen/logrus"
1110 "encoding/json"
1211 "fmt"
1312 "os"
1413 "os/exec"
14+
15+ "github.com/sirupsen/logrus"
1516)
1617
1718// RunLizard runs the Lizard tool and returns any issues found
@@ -20,8 +21,6 @@ func RunLizard(workDirectory string, binary string, files []string, outputFile s
2021 configFile , exists := tools .ConfigFileExists (config .Config , "lizard.yaml" )
2122 var patterns []domain.PatternDefinition
2223 var errConfigs error
23-
24-
2524 if exists {
2625 // Configuration exists, read from file
2726 patterns , errConfigs = ReadConfig (configFile )
@@ -38,8 +37,6 @@ func RunLizard(workDirectory string, binary string, files []string, outputFile s
3837 if len (patterns ) == 0 {
3938 return fmt .Errorf ("no valid patterns found in configuration" )
4039 }
41-
42-
4340 // Construct base command with lizard module
4441 args := []string {"-m" , "lizard" , "-V" }
4542
@@ -50,23 +47,20 @@ func RunLizard(workDirectory string, binary string, files []string, outputFile s
5047 args = append (args , "." )
5148 }
5249
53-
5450 // For non-SARIF output, let Lizard handle file output directly
5551 if outputFormat != "sarif" && outputFile != "" {
5652 args = append (args , "-o" , outputFile )
5753 }
5854
59-
6055 // Run the command
6156 cmd := exec .Command (binary , args ... )
6257 cmd .Dir = workDirectory
6358
64-
6559 var err error
6660 var stderr bytes.Buffer
67-
61+
6862 cmd .Stderr = & stderr
69-
63+
7064 // For SARIF output, we need to capture and parse the output
7165 if outputFormat == "sarif" {
7266 var stdout bytes.Buffer
0 commit comments