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

Make commit & tag messages build-level settings #205

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ches
Copy link

@ches ches commented Jul 12, 2017

I end up doing this in every project where I use sbt-release:

lazy val releaseSettings = Seq(
  // Commit messages should use imperative mood
  releaseTagComment := s"Release ${(version in ThisBuild).value}",
  releaseCommitMessage := s"Set version to ${(version in ThisBuild).value}"
)

Then I need to add settings(releaseSettings) to every applicable module of multi-project builds or include them in some common settings collection. That has become tedious, so here I am. I would like for these to be able to delegate to ThisBuild so I can just do this once, perhaps even in an umbrella plugin for team standards:

releaseTagComment in ThisBuild := s"Release ${(version in ThisBuild).value}"
releaseCommitMessage in ThisBuild := s"Set version to ${(version in ThisBuild).value}"

Could more settings sensibly move to buildSettings? Quite possibly, I didn't think about it very hard, these are ones that initially were of interest to me but I'm open to suggestions.

Also the scripted suite seems to have some issue in my environment, if Travis fails for this PR or you'd like a new test for this change I'll dig further into what's not kosher on my machine. Apologies for being in a bit of a rush.

(By the way, if you're open to changing the default messages to present tense, imperative mood as many style guides call for in accordance with the Git project's own convention, I'd be happy to change it. But I suspect people could have automation scripting in their pipeline reliant on the existing default messages, so it might be considered a compatibility breakage).

@leonardehrenfried
Copy link
Contributor

The failing Travis test are due to the upgrade to 0.13.15.

I've fixed them in my recent SBT 1.0 PR.

If you rebase this PR onto the current master, they should disappear.

@leonardehrenfried
Copy link
Contributor

Oh, and by the way, I fully support this PR and the use of present tense in particular.

I agree that this should be in a version 2.x though.

@ches
Copy link
Author

ches commented Aug 1, 2017

The failing Travis test are due to the upgrade to 0.13.15.

Aha, thank you for the heads up! I'd had no chance to come back and investigate yet since the build ran but that will make it much easier to dig back in. I'll try to update the PR soon and perhaps also carve out the time to more thoroughly consider what else can/should sensibly be ThisBuild-scoped.

@BardurArantsson
Copy link

BardurArantsson commented Sep 25, 2018

@xuwei-k Any chance of any movement on this? It seems the current situation also makes it impossible to override these settings with a "house rules" plugin, i.e. a company-local plugin we use across our code bases to supply sensible defaults to the other plugins we're using.

(I'll be happy to take over the PR by resolving conflicts or whatever, but I won't bother if it's just going to linger...)

EDIT: ... just add, I'd also be happy if the message could just be changed to present tense -- it's such an eyesore to have the automatic commit messages be the "bad" ones...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants