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

Add an option to make messages capitalized #80

Open
lexuzieel opened this issue Jul 18, 2022 · 8 comments · May be fixed by #86 or #81
Open

Add an option to make messages capitalized #80

lexuzieel opened this issue Jul 18, 2022 · 8 comments · May be fixed by #86 or #81

Comments

@lexuzieel
Copy link

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)?

@MichaelCurrin
Copy link
Owner

Hi, thanks for the interest and suggestion.

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

@MichaelCurrin MichaelCurrin linked a pull request Jul 26, 2022 that will close this issue
@MichaelCurrin
Copy link
Owner

MichaelCurrin commented Jul 26, 2022

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
Copy link
Owner

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

@lexuzieel
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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: lexuzieel@7440e07

@lexuzieel
Copy link
Author

lexuzieel commented Nov 14, 2022

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 lexuzieel linked a pull request Nov 14, 2022 that will close this issue
@MichaelCurrin
Copy link
Owner

Thanks for the info. Reviewing your PR now

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