diff --git a/src/lib/actions/ConfigAction.ts b/src/lib/actions/ConfigAction.ts index 72298d485..1c80af3d8 100644 --- a/src/lib/actions/ConfigAction.ts +++ b/src/lib/actions/ConfigAction.ts @@ -62,23 +62,15 @@ export class ConfigAction { telemetryListener.listen(userCore); const enginePlugins: EnginePlugin[] = this.dependencies.pluginsFactory.create(); - const enginePluginModules: string[] = userConfig.getCustomEnginePluginModules(); const userEnginePromises: Promise[] = [ ...enginePlugins.map(enginePlugin => userCore.addEnginePlugin(enginePlugin)), - ...enginePluginModules.map(pluginModule => userCore.dynamicallyAddEnginePlugin(pluginModule)), ]; await Promise.all(userEnginePromises); // ==== PREPARE DEFAULT CONFIG (with disable_engine settings kept) AND DEFAULT CODE ANALYZER =================== - // TODO: We are currently only passing in the enginePlugins here which are not all plugins. We need to - // include the dynamically loaded plugins... but dynamicallyAddEnginePlugin loads and adds and so we never get - // access to the plugins. We need to update core to separate the concerns so that we just have a - // dynamicallyLoadEnginePlugin to just return the plugin so that we can add these plugins to this list. - // And/Or we could just have the Code Analyzer class return a list of the engines that were disabled so that - // we don't need this helper function here. const disabledEngines: string[] = getDisabledEngineNames(enginePlugins, new Set(userCore.getEngineNames())); type engineDisableInfo = { engines: { [key: string]: { disable_engine: boolean } } }; @@ -95,10 +87,6 @@ export class ConfigAction { const defaultEnginePromises: Promise[] = [ ...enginePlugins.map(enginePlugin => defaultCoreForAllRules.addEnginePlugin(enginePlugin)), ...enginePlugins.map(enginePlugin => defaultCoreForSelectRules.addEnginePlugin(enginePlugin)), - // Assumption: Every engine's default configuration is sufficient to allow that engine to be instantiated, - // or throw a clear error indicating the problem. - ...enginePluginModules.map(pluginModule => defaultCoreForAllRules.dynamicallyAddEnginePlugin(pluginModule)), - ...enginePluginModules.map(pluginModule => defaultCoreForSelectRules.dynamicallyAddEnginePlugin(pluginModule)), ]; await Promise.all(defaultEnginePromises); diff --git a/src/lib/actions/RulesAction.ts b/src/lib/actions/RulesAction.ts index 417e579a8..da4341d2c 100644 --- a/src/lib/actions/RulesAction.ts +++ b/src/lib/actions/RulesAction.ts @@ -52,10 +52,8 @@ export class RulesAction { const telemetryListener: TelemetryEventListener = new TelemetryEventListener(this.dependencies.telemetryEmitter); telemetryListener.listen(core); const enginePlugins = this.dependencies.pluginsFactory.create(); - const enginePluginModules = config.getCustomEnginePluginModules(); const addEnginePromises: Promise[] = [ - ...enginePlugins.map(enginePlugin => core.addEnginePlugin(enginePlugin)), - ...enginePluginModules.map(pluginModule => core.dynamicallyAddEnginePlugin(pluginModule)) + ...enginePlugins.map(enginePlugin => core.addEnginePlugin(enginePlugin)) ]; await Promise.all(addEnginePromises); const workspace: string[]|undefined = input.workspace || (input.target ? ['.'] : undefined); diff --git a/src/lib/actions/RunAction.ts b/src/lib/actions/RunAction.ts index f36013405..68f692465 100644 --- a/src/lib/actions/RunAction.ts +++ b/src/lib/actions/RunAction.ts @@ -80,10 +80,8 @@ export class RunAction { const telemetryListener: TelemetryEventListener = new TelemetryEventListener(this.dependencies.telemetryEmitter); telemetryListener.listen(core); const enginePlugins = this.dependencies.pluginsFactory.create(); - const enginePluginModules = config.getCustomEnginePluginModules(); const addEnginePromises: Promise[] = [ - ...enginePlugins.map(enginePlugin => core.addEnginePlugin(enginePlugin)), - ...enginePluginModules.map(pluginModule => core.dynamicallyAddEnginePlugin(pluginModule)) + ...enginePlugins.map(enginePlugin => core.addEnginePlugin(enginePlugin)) ]; await Promise.all(addEnginePromises); const workspace: Workspace = await createWorkspace(core, input.workspace, input.target); diff --git a/test/lib/actions/RulesAction.test.ts b/test/lib/actions/RulesAction.test.ts index 5714fccf2..1a278e126 100644 --- a/test/lib/actions/RulesAction.test.ts +++ b/test/lib/actions/RulesAction.test.ts @@ -309,7 +309,3 @@ describe('RulesAction tests', () => { }); }) }); - -// TODO: Whenever we decide to document the custom_engine_plugin_modules flag in our configuration file, then we'll want -// to add in tests to lock in that behavior. But for now, it is a hidden utility for us to use internally, so no tests -// have been added. diff --git a/test/lib/actions/RunAction.test.ts b/test/lib/actions/RunAction.test.ts index ac6744866..73bf04946 100644 --- a/test/lib/actions/RunAction.test.ts +++ b/test/lib/actions/RunAction.test.ts @@ -586,7 +586,3 @@ describe('RunAction tests', () => { }); }); }); - -// TODO: Whenever we decide to document the custom_engine_plugin_modules flag in our configuration file, then we'll want -// to add in tests to lock in that behavior. But for now, it is a hidden utility for us to use internally, so no tests -// have been added.