aicommits icon indicating copy to clipboard operation
aicommits copied to clipboard

feat: enable conventional commits & Gitmoji πŸš€ as configuration options

Open ThijSlim opened this issue 1 year ago β€’ 15 comments

Add configuration to enable conventional commits. By default it is "false" to not break existing behavior. In the future this could be defaulted to "true", if that is a global standard.

ThijSlim avatar Mar 17 '23 09:03 ThijSlim

Closes #32

ThijSlim avatar Mar 17 '23 09:03 ThijSlim

How does one test this GitHub PR with the set conventional commits since there are not flags set?

NorkzYT avatar Mar 18 '23 05:03 NorkzYT

I don’t know what you mean, could you explain this in bit more detail? I tested this through the specs and it seems to add almost always the right conventional commit type.

I do think that there needs to be an option to override the type whenever a user simply wants a specific one, but lets add that in a different PR?

ThijSlim avatar Mar 18 '23 08:03 ThijSlim

Will do.

After switching to this GitHub PR, I ran some tests locally using the following commands. However, I did not obtain the expected conventional commit output. This prompted me to consider the possibility of requiring some configuration.

pnpm i
pnpm build
node ./dist/cli.mjs

NorkzYT avatar Mar 18 '23 14:03 NorkzYT

I am planning to submit a GitHub PR. In the near future, I would like to see the aicommits command output to include a GitEmoji, conventional commit message, and two lines under, a body explaining the purpose of the commit, which will require modifying the prompt.

An example is shown below in the following issue comment.

https://github.com/Nutlope/aicommits/pull/76#issuecomment-1474676628

NorkzYT avatar Mar 18 '23 14:03 NorkzYT

I will check if I can include it in this PR, also adding more testing and refining the prompt.

ThijSlim avatar Mar 18 '23 16:03 ThijSlim

Understood, thank you.

Currently I am running tests myself.

NorkzYT avatar Mar 18 '23 16:03 NorkzYT

@NorkzYT I greatly improved the tests, I also made the conventional commits more context aware and added Gitmoji to the mix.

ThijSlim avatar Mar 18 '23 21:03 ThijSlim

I can't set config using this approach. would you recommend adding gitmoji and conventional as cli flags?

pnpm i
pnpm build
node ./dist/cli.mjs

ThijSlim avatar Mar 18 '23 21:03 ThijSlim

Nice mate, great work!

Now I need to make an issue since the @dqbd/tiktoken needs to be updated to 1.0.2 and change the const encoder = encodingForModel('text-davinci-003'); code to use gpt-3.5-turbo since the current code only uses GPT3.

Related issue: https://github.com/dqbd/tiktoken/issues/17

Related GitHub PR: https://github.com/Nutlope/aicommits/pull/123

NorkzYT avatar Mar 18 '23 21:03 NorkzYT

I can't set config using this approach. would you recommend adding gitmoji and conventional as cli flags?

pnpm i
pnpm build
node ./dist/cli.mjs

I will see what I can do.

NorkzYT avatar Mar 18 '23 21:03 NorkzYT

@thijslimmen

Earlier I read your question incorrectly. Yes, it would be beneficial for future use cases to have both conventional commits and gitmojis to have cli flags.

NorkzYT avatar Mar 18 '23 21:03 NorkzYT

Also, with the increasing amount of features, usability becomes a thing, because sometimes someone finds the text correct, but then the conventional commit type or gitmoji may not be right, so it would be nice to mix and match all the generated features.

ThijSlim avatar Mar 18 '23 22:03 ThijSlim

Agreed.

NorkzYT avatar Mar 18 '23 22:03 NorkzYT

Opened a PR with new changes. https://github.com/Nutlope/aicommits/pull/163

NorkzYT avatar Mar 20 '23 16:03 NorkzYT