@@ -263,21 +263,28 @@ func getToolName(toolName string, version string) string {
263263func runToolByTooName (toolName string , workDirectory string , pathsToCheck []string , autoFix bool , outputFile string , outputFormat string , tool * plugins.ToolInfo , runtime * plugins.RuntimeInfo ) error {
264264 switch toolName {
265265 case "eslint" :
266- return tools .RunEslint (workDirectory , tool .InstallDir , runtime .Binaries [tool .Runtime ], pathsToCheck , autoFix , outputFile , outputFormat )
266+ binaryPath := runtime .Binaries [tool .Runtime ]
267+ return tools .RunEslint (workDirectory , tool .InstallDir , binaryPath , pathsToCheck , autoFix , outputFile , outputFormat )
267268 case "trivy" :
268- return tools .RunTrivy (workDirectory , tool .Binaries [tool .Runtime ], pathsToCheck , outputFile , outputFormat )
269+ binaryPath := tool .Binaries [toolName ]
270+ return tools .RunTrivy (workDirectory , binaryPath , pathsToCheck , outputFile , outputFormat )
269271 case "pmd" :
270- return tools .RunPmd (workDirectory , tool .Binaries [tool .Runtime ], pathsToCheck , outputFile , outputFormat , config .Config )
272+ binaryPath := tool .Binaries [toolName ]
273+ return tools .RunPmd (workDirectory , binaryPath , pathsToCheck , outputFile , outputFormat , config .Config )
271274 case "pylint" :
272- return tools .RunPylint (workDirectory , tool .Binaries [tool .Runtime ], pathsToCheck , outputFile , outputFormat )
275+ binaryPath := tool .Binaries [tool .Runtime ]
276+ return tools .RunPylint (workDirectory , binaryPath , pathsToCheck , outputFile , outputFormat )
273277 case "dartanalyzer" :
274- return tools .RunDartAnalyzer (workDirectory , tool .InstallDir , tool .Binaries [tool .Runtime ], pathsToCheck , outputFile , outputFormat )
278+ binaryPath := tool .Binaries [tool .Runtime ]
279+ return tools .RunDartAnalyzer (workDirectory , tool .InstallDir , binaryPath , pathsToCheck , outputFile , outputFormat )
275280 case "semgrep" :
276- return tools .RunSemgrep (workDirectory , tool .Binaries [tool .Runtime ], pathsToCheck , outputFile , outputFormat )
281+ binaryPath := tool .Binaries [toolName ]
282+ return tools .RunSemgrep (workDirectory , binaryPath , pathsToCheck , outputFile , outputFormat )
277283 case "lizard" :
278- return lizard .RunLizard (workDirectory , tool .Binaries [tool .Runtime ], pathsToCheck , outputFile , outputFormat )
279- case "enigma" :
280- return tools .RunEnigma (workDirectory , tool .InstallDir , tool .Binaries [tool .Runtime ], pathsToCheck , outputFile , outputFormat )
284+ binaryPath := tool .Binaries [tool .Runtime ]
285+ return lizard .RunLizard (workDirectory , binaryPath , pathsToCheck , outputFile , outputFormat )
286+ case "codacy-enigma-cli" :
287+ return tools .RunEnigma (workDirectory , tool .InstallDir , tool .Binaries ["codacy-enigma-cli" ], pathsToCheck , outputFile , outputFormat )
281288 case "revive" :
282289 return reviveTool .RunRevive (workDirectory , tool .Binaries ["revive" ], pathsToCheck , outputFile , outputFormat )
283290 }
@@ -286,7 +293,12 @@ func runToolByTooName(toolName string, workDirectory string, pathsToCheck []stri
286293
287294func genericRunTool (toolName string , workDirectory string , pathsToCheck []string , autoFix bool , outputFile string , outputFormat string ) error {
288295 tool := config .Config .Tools ()[toolName ]
289- isToolInstalled := config .Config .IsToolInstalled (toolName , tool )
296+ var isToolInstalled bool
297+ if tool == nil {
298+ isToolInstalled = false
299+ } else {
300+ isToolInstalled = config .Config .IsToolInstalled (toolName , tool )
301+ }
290302 var isRuntimeInstalled bool
291303
292304 var runtime * plugins.RuntimeInfo
0 commit comments