auto-commit-msg icon indicating copy to clipboard operation
auto-commit-msg copied to clipboard

Add an option to make messages capitalized

Open lexuzieel opened this issue 3 years ago • 8 comments

Hello!

In my repos I write messages starting with capital letter. Whilst this extension gets the message correct, it does not capitalize the message.

i.e. currently when I change a file and press a button, I get this message: image

I have to change the first letter of the message to capital manually: image

Is there a way to change this behavior (probably through settings)?

lexuzieel avatar Jul 18 '22 23:07 lexuzieel

Hi, thanks for the interest and suggestion.

I'll add this as something you can control in settings.

MichaelCurrin avatar Jul 22 '22 08:07 MichaelCurrin

Hi, I added a draft PR. I got this working for a narrow usecase, now need to get it to work for multiple file changes and when not using a type prefix.

MichaelCurrin avatar Jul 26 '22 15:07 MichaelCurrin

Here's how it is configured: Screenshot_2022-07-26_17-39-33

MichaelCurrin avatar Jul 26 '22 15:07 MichaelCurrin

Hey that looks great! Sorry for late response. I see that PR is failing on build but the logs are expired, so I cannot see them. Could you please re-run the job?

lexuzieel avatar Oct 25 '22 10:10 lexuzieel

I have forked your version and fixed linter errors, however I was not able to build current version due to error

Error: Cannot find module 'vscode'

https://github.com/avixFF/auto-commit-msg/actions/runs/3463893007/jobs/5784743972

lexuzieel avatar Nov 14 '22 18:11 lexuzieel

Alright, so I figured out why there was build problem and it was not at all trivial.

Turns out Microsoft has updated vscode package.

This in turn required mocha downgrade to version 4 Which required rewriting tests using only test() function That triggered linter, since it made lines greater than 100 characters long Because of that I had to shorten some test messages

So in order to use vscode package you have to run tests inside an actual vscode instance. Document linked above explains it. The build was failing because you were including prepareCommitMsg.ts in prepareCommitMsg.test.ts which had vscode package import that was not accessible when run with mocha from CLI.

In my branch I have changed that your mocha tests run inside vscode instance, therefore vscode package is accessible for tests.

Here is my version: https://github.com/avixFF/auto-commit-msg/commit/7440e072b61beaa3804f258c57037a249282d575

lexuzieel avatar Nov 14 '22 19:11 lexuzieel

While we are at it, I would also like to add a flag to disable prefix (I don't use those for my projects). I have created a separate PR based on the latest version of my feat-titlecase branch: #86

lexuzieel avatar Nov 14 '22 20:11 lexuzieel

Thanks for the info. Reviewing your PR now

MichaelCurrin avatar Nov 21 '22 20:11 MichaelCurrin