@@ -528,15 +528,28 @@ type WorkspaceFoldersChangeEvent struct {
528
528
Removed []WorkspaceFolder `json:"Removed,omitempty"`
529
529
}
530
530
531
+ // ScanCommandConfig allows to define a command that is run before (PreScanCommand)
532
+ // or after (PostScanCommand) a scan. It will only be run for the
533
+ // referenceFolder / referenceScan (in case of delta) if the corresponding
534
+ // parameter PreScanOnlyReferenceFolder / PostScanOnlyReferenceFolder is set.
535
+ // Else it will run for all scans.
536
+ type ScanCommandConfig struct {
537
+ PreScanCommand string `json:"command,omitempty"`
538
+ PreScanOnlyReferenceFolder bool `json:"preScanOnlyReferenceFolder,omitempty"`
539
+ PostScanCommand string `json:"postScanCommand,omitempty"`
540
+ PostScanOnlyReferenceFolder bool `json:"postScanOnlyReferenceFolder,omitempty"`
541
+ }
542
+
531
543
// FolderConfig is exchanged between IDE and LS
532
544
// IDE sends this as part of the settings/initialization
533
545
// LS sends this via the $/snyk.folderConfig notification
534
546
type FolderConfig struct {
535
- FolderPath string `json:"folderPath"`
536
- BaseBranch string `json:"baseBranch"`
537
- LocalBranches []string `json:"localBranches,omitempty"`
538
- AdditionalParameters []string `json:"additionalParameters,omitempty"`
539
- ReferenceFolderPath string `json:"referenceFolderPath,omitempty"`
547
+ FolderPath string `json:"folderPath"`
548
+ BaseBranch string `json:"baseBranch"`
549
+ LocalBranches []string `json:"localBranches,omitempty"`
550
+ AdditionalParameters []string `json:"additionalParameters,omitempty"`
551
+ ReferenceFolderPath string `json:"referenceFolderPath,omitempty"`
552
+ ScanCommandConfig ScanCommandConfig `json:"scanCommandConfig,omitempty"`
540
553
}
541
554
542
555
type Pair struct {
0 commit comments