reibitto / sbt-welcome

An SBT plugin for displaying a welcome message and commonly used tasks.
Apache License 2.0
79 stars 4 forks source link

Auto-bullets for aliases #5

Closed davesmith00000 closed 1 year ago

davesmith00000 commented 2 years ago

Currently you have to set the alias values yourself, which is ok, but it's very easy to make a mistake.

If I have a welcome config like:

UsefulTask("a", "clean", "...")
UsefulTask("b", "test", "...")
UsefulTask("c", "publishLocal", "...")

and then I realise I forgot compile (in this contrived example), there is nothing stopping me doing this:

UsefulTask("a", "clean", "...")
UsefulTask("b", "compile", "...")
UsefulTask("b", "test", "...")
UsefulTask("c", "publishLocal", "...")

Now I have two b's!

It would be nice if there was a construct that organised the aliases for me, so they are sequential and unique.

reibitto commented 2 years ago

That's a good point. I think an auto-increment like that would be useful. I'm not quite sure how to model that currently, but maybe I need to make alias a proper ADT rather than just String?

Or maybe I can add a Config case class and add a new sbt setting for it.