Skip to content

Commit ed0fa46

Browse files
committed
chore: add extra function to avoid breaking change
1 parent c248591 commit ed0fa46

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

scan.go

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ type CodeScanner interface {
5454
target scan.Target,
5555
files <-chan string,
5656
changedFiles map[string]bool,
57-
options ...AnalysisOption,
58-
) (*sarif.SarifResponse, string, *scan.ResultMetaData, error)
57+
) (*sarif.SarifResponse, string, error)
5958
}
6059

6160
var _ CodeScanner = (*codeScanner)(nil)
@@ -182,13 +181,24 @@ func (c *codeScanner) WithAnalysisOrchestrator(analysisOrchestrator analysis.Ana
182181
}
183182
}
184183

185-
// UploadAndAnalyze returns a fake SARIF response for testing. Use target-service to run analysis on.
186184
func (c *codeScanner) UploadAndAnalyze(
187185
ctx context.Context,
188186
requestId string,
189187
target scan.Target,
190188
files <-chan string,
191189
changedFiles map[string]bool,
190+
) (*sarif.SarifResponse, string, error) {
191+
sarif, bundleHash, _, err := c.UploadAndAnalyzeWithOptions(ctx, requestId, target, files, changedFiles)
192+
return sarif, bundleHash, err
193+
}
194+
195+
// UploadAndAnalyze returns a fake SARIF response for testing. Use target-service to run analysis on.
196+
func (c *codeScanner) UploadAndAnalyzeWithOptions(
197+
ctx context.Context,
198+
requestId string,
199+
target scan.Target,
200+
files <-chan string,
201+
changedFiles map[string]bool,
192202
options ...AnalysisOption,
193203
) (*sarif.SarifResponse, string, *scan.ResultMetaData, error) {
194204
cfg := analysis.AnalysisConfig{}

0 commit comments

Comments
 (0)