beachball icon indicating copy to clipboard operation
beachball copied to clipboard

Personalize change files commit message

Open klaygomes opened this issue 6 years ago • 5 comments

https://github.com/microsoft/beachball/blob/ca6a8b2ed1675a533a7d62c8b55de687bc7ba40a/packages/beachball/src/changefile/writeChangeFiles.ts#L47

Would be great if we could personalize it. For example, today I'm using commitzen as our conversion and it breaks our pre-hook commit message lint.

klaygomes avatar Apr 03 '20 05:04 klaygomes

Agreed––although I see an -m flag described in the docs, I was unable to override the commits. I tried doing this both with beachball change and beachball publish.

Aside from this one drawback, I'm loving this tool. Great work @kenotron. What a gorgeous and minimal utility!

harrysolovay avatar Apr 10 '20 03:04 harrysolovay

Users are likely to run into this error upon trying to integrate beachball into their workflow. Skipping commit message verification does the job, but it's inconsistent. For those that want consistency in their commit message style, this is a dealbreaker.

Screen Shot 2020-04-12 at 5 32 43 PM

harrysolovay avatar Apr 13 '20 00:04 harrysolovay

Just ran into this while using commitlint and husky, like the above comment. No progress?

Edit: For anyone using commitlint, husky, and beachball, adding the following to your commitling.config.js file works:

module.exports = {
  ignores: [(message) => message.startsWith('Change files')],
};

kate-hall avatar Oct 07 '20 17:10 kate-hall

@kate-hall yes, that's another good solution for the short-term! Ideally we wouldn't need such workarounds. We'll see how this repo progresses :)

harrysolovay avatar Nov 04 '20 20:11 harrysolovay

This should be pretty simple to add if anyone is interested.

Add an option to RepoOptions here, maybe call it changeFilesCommitMessage https://github.com/microsoft/beachball/blob/f98b5e3afe2533100018076926cd64b8c7069b0c/src/types/BeachballOptions.ts#L47

The actual commit message is inside writeChangeFiles, which doesn't currently have access to the options object (and it would be annoying to add due to usage in tests). So instead you could add an optional parameter commitMessage... https://github.com/microsoft/beachball/blob/f98b5e3afe2533100018076926cd64b8c7069b0c/src/changefile/writeChangeFiles.ts#L12

Then pass it in from options.commitMessage here. https://github.com/microsoft/beachball/blob/f98b5e3afe2533100018076926cd64b8c7069b0c/src/commands/change.ts#L9

ecraig12345 avatar Jul 23 '21 01:07 ecraig12345