vscode-maven
vscode-maven copied to clipboard
Adds test scope automatically
Suggestion
I'd like that when I add a library that it is for testing purposes, it automatically sets the scope as test
and not leave it empty.
Use Cases
I'd like that when I add a library that it is for testing purposes, it automatically sets the scope as test
and not leave it empty. For example if I add the JUnit dependency, in 90% of my cases and probably 99% of the normal use cases it is to write tests, the same for selenium, testcontainers, ... So it will be nice that you can enable this auto scope thing, providing a default libraries file where this is applied + as a user be able to add some more.
Examples
It's a "wow" feature. But I'm voting -1 for this feature request. My biggest concerns are:
- how to infer the scope for a dependency? I don't think hardcoding is a good choice, but now I cannot think of any other.
- it will introduce inconsistency/confusion, users will get confused why scope library A is automatically set to
test
while libraray B is not.
The benefit might be some convenience, but the drawback is potential risk of wrong scopes which are not easy to find. So I prefer not to do that much, and hand it over to users, make it transparent and consistent.
Well yes, it is fair what you are saying but what if the extension lets you as a developer configure it. Now you cannot do it, but how about by default be an empty list so it behaves like now, but the user is allowed to configure that if junit dep is added then the scope is test? This could be added as a key value in the file ie:
org.junit:junit=test,
org.selenium:firefox-driver:test
It looks acceptable. PR is welcome 😄, and please also update the corresponding section in README for the new config schema.