Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Append a plugin with command line (without removing configured plugins) #2253

Closed
Garethp opened this issue Jun 10, 2020 · 5 comments
Closed
Labels
🚀 Feature request New feature request

Comments

@Garethp
Copy link
Contributor

Garethp commented Jun 10, 2020

Is your feature request related to a problem? Please describe.
I want to be able to add a plugin through command line (A new reporter), without removing existing plugins. When writing a tool that tried to add functionality to Stryker, I don't know what plugins are being included with the configuration file, but if I try to add it through --plugins, then it removes any plugins already specified (Such as typescript)

Describe the solution you'd like
I'd like a new --plugin argument that appends to the array of plugins, rather than replacing it

Describe alternatives you've considered
I've considered parsing the config file, but that seems rather onerous since my tool isn't built in JS. I've also considered just adding @stryker-mutator/*, but the user might be using other plugins (Like I intend to with Specific Lines filter).

A workaround that I'll likely use without this feature is to ask users to have this plugin specified in their config file, but it's not something that my tool can verify that they're using (and therefore would cause an error if I try to specify that this reporter should be used), so it would better if my tool can explicitly say that this plugin should be in use

@Garethp Garethp added the 🚀 Feature request New feature request label Jun 10, 2020
@Garethp Garethp changed the title Add a plugin with command line (without removing configured plugins) Append a plugin with command line (without removing configured plugins) Jun 10, 2020
@nicojs
Copy link
Member

nicojs commented Jun 10, 2020

Hi 🤝 @Garethp let me take care of that coat for you🧥, feel free to get a coffee in the kitchen ☕!

Normally it should not be needed to override plugins from the command line. You should be able to always load all plugins, but only activate those you want to be activated. The only plugin type that is always active right now are ConfigEditor plugins, but we're planning to remove that type.

For example, you can load @stryker-mutator/typescript, but not choose to use --mutator typescript, or use --transpilers typescript.

The plugin type you are interested in is the new checker api, correct? That should follow the same trend as transpilers or mutator.

Does this solve your issue?

@Garethp
Copy link
Contributor Author

Garethp commented Jun 10, 2020

That's one plugin I'd like to load in the future, but what I'm looking at in this specific instance is a new reporter that I've made for use in my intellij plugin.

My ideal usage for this feature is to allow my IDE plugin to simply call stryker run --plugin stryker-intellij-reporter --reporters intellij [file], so that I can have a zero config setup for people using the plugin. My plugin can detect if the stryker-intellij-reporter package is available, but it's unable to detect if it's been included in the stryker config, so without being able to explicitly state that the plugin must be included there's more chance of user error.

And personally as a user of my own plugin, I'd rather not have to add this to the config for a whole team when myself or one other dev might be the only one using the plugin, since it's IDE/dev specific and not project specific.

@nicojs
Copy link
Member

nicojs commented Jun 25, 2020

Cool! I think I now understand what you mean.

I see 2 ways of implementing this.

  1. We change the way the --plugins works and let it just append plugins (breaking change). We could still allow users to delete all plugins with --no-plugins for example.
  2. We add a new command-line argument --append-plugins which prevents plugins to be cleared (minor change).

I'm actually leaning towards option 2.

What do you think @Garethp?

cc @simondel

@Garethp
Copy link
Contributor Author

Garethp commented Jun 25, 2020

Option 2 sounds like the clearest way to interact with it

@nicojs
Copy link
Member

nicojs commented Sep 28, 2020

Merged with #2385

@nicojs nicojs closed this as completed Sep 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 Feature request New feature request
Projects
None yet
Development

No branches or pull requests

2 participants