-
Notifications
You must be signed in to change notification settings - Fork 245
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
Make flag support type safe through the sbt plugin #149
Conversation
Sounds good in theory; what's the weird behavior you are seeing? |
@nshkrob This was a long time ago, but I believe the "weird" behavior I was refering to is the possibility to pass the "-help" flag or another fairly nonsensical flag to pass to this |
Actually I think it's better to keep flags a String as a way of passing in any possible flag, e.g. --verbose, --default-java-namespace, etc. Removing it would break the people who are using it for these options. |
I disagree. If I remember correctly, most of the command line options don't I am on my phone. I will go through the list when I get back in the office
|
I would argue that dry-run and version do not make a whole lot of sense for an automated build definition not too mention that most of the flags overlap with existing sbt keys exposed by the scrooge plugin and could lead to confusing behavior if defined twice. |
The full list of options is at twitter.github.io/scrooge/CommandLine.html. I agree on the dry-run and version options, but there needs to be a way to set the rest of them. If you provide an alternative way to set all these options this might work. You'll also need to update the docs at https://github.com/twitter/scrooge/blob/master/doc/src/sphinx/SBTPlugin.rst The performance win after removing option parsing is likely very minor, so I think it isn't worth the loss of flexibility. |
This has the added advantage of bypassing the huge parsing step that didn’t ever really need to be called, so should make things altogether faster on top of avoiding weird behavior. Does it really make much sense to supply the “-help” in your sbt build?
…ty in a more typesafe way.
2529986
to
e2c9ccc
Compare
@nshkrob Sorry for the long delay! Got distracted by other things. |
LGTM, let's see if we can merge this in! |
This is extremely stupid, but adding some of these flags tips us over the edge to too many arguments for sbt. It only goes up to 11. So I removed experimental flags because we don't seem to use them anywhere. |
@mosesn Do you want me to rebase this or are you going to do that as part of your internal merging process (twitter open source still works that way?)? |
Yeah, I'll do it as part of the internal merging process, thanks! It's up for review internally now. |
This made it to |
This has the added advantage of bypassing the huge parsing step that didn’t ever really need to be called, so should make things altogether faster on top of avoiding weird behavior. Does it really make much sense to supply the “-help” in your sbt build?