ajoberstar / reckon

Infer a project's version from your Git repository.
Apache License 2.0
184 stars 28 forks source link

`ReckonExtension.setDefaultInferredScope` could take `org.ajoberstar.reckon.core.Scope` #175

Closed x80486 closed 1 year ago

x80486 commented 2 years ago

I think ReckonExtension.setDefaultInferredScope/1 could be overloaded to accept org.ajoberstar.reckon.core.Scope as well — unless this one is not supposed to be used somehow.

I'm currently using it like:

reckon {
  setDefaultInferredScope(Scope.PATCH as String)
  setScopeCalc(calcScopeFromProp())
  setStageCalc(calcStageFromProp())
  stages("beta", "rc", "final")
}

...but I think accepting the enum as well is better because using constant is less error prone, and can provide a (very) small performance advantage.

ajoberstar commented 1 year ago

Overload seems fine to me. Personally think the need to do an import to get the enum approach to work is going to be more error prone than using the string.