MCPcopy
hub / github.com/snyk/cli / buildPluginOptions

Function buildPluginOptions

src/lib/plugins/build-plugin-options.ts:11–36  ·  view source on GitHub ↗
(
  options: Options & (TestOptions | MonitorOptions),
  featureFlags: Set<string> = new Set<string>(),
)

Source from the content-addressed store, hash-verified

9 * plugin-specific configuration injected.
10 */
11export async function buildPluginOptions(
12 options: Options & (TestOptions | MonitorOptions),
13 featureFlags: Set<string> = new Set<string>(),
14): Promise<Options & (TestOptions | MonitorOptions)> {
15 const pluginOptions: any = { ...options };
16
17 const isGoPackageManager =
18 options.packageManager === 'gomodules' ||
19 options.packageManager === 'golangdep';
20
21 if (isGoPackageManager) {
22 pluginOptions.configuration = {
23 ...(pluginOptions.configuration || {}),
24 includeGoStandardLibraryDeps: featureFlags.has(
25 INCLUDE_GO_STANDARD_LIBRARY_DEPS_FEATURE_FLAG,
26 ),
27 includePackageUrls: !featureFlags.has(
28 DISABLE_GO_PACKAGE_URLS_IN_CLI_FEATURE_FLAG,
29 ),
30 // enable fix for replaced modules.
31 useReplaceName: true,
32 } as Options['configuration'];
33 }
34
35 return pluginOptions;
36}

Callers 1

getSinglePluginResultFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected