From f14f9104d6851a2b705dd22a9363686e22509824 Mon Sep 17 00:00:00 2001 From: Wilian Gabriel Date: Thu, 3 Feb 2022 08:37:52 -0300 Subject: [PATCH] fix:semgrep - Disable collect metrics and fix log message (#968) In this commit I change semgrep tool to not collect information of the your analysis. And I found an error in Log when semgrep fails was showing the tool name wrong. Signed-off-by: wilian --- internal/services/formatters/generic/semgrep/config.go | 2 +- internal/services/formatters/generic/semgrep/formatter.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/services/formatters/generic/semgrep/config.go b/internal/services/formatters/generic/semgrep/config.go index 3a4de2b87..276a4bf85 100644 --- a/internal/services/formatters/generic/semgrep/config.go +++ b/internal/services/formatters/generic/semgrep/config.go @@ -16,5 +16,5 @@ package semgrep const CMD = ` {{WORK_DIR}} - semgrep --config=p/r2c-ci -q --json . + semgrep --disable-metrics --config=p/r2c-ci -q --json . ` diff --git a/internal/services/formatters/generic/semgrep/formatter.go b/internal/services/formatters/generic/semgrep/formatter.go index a208eee4d..819de0b7f 100644 --- a/internal/services/formatters/generic/semgrep/formatter.go +++ b/internal/services/formatters/generic/semgrep/formatter.go @@ -49,7 +49,7 @@ func (f *Formatter) StartAnalysis(projectSubPath string) { } output, err := f.startSemgrep(projectSubPath) - f.SetAnalysisError(err, tools.SecurityCodeScan, output, projectSubPath) + f.SetAnalysisError(err, tools.Semgrep, output, projectSubPath) f.LogDebugWithReplace(messages.MsgDebugToolFinishAnalysis, tools.Semgrep, languages.Generic) }