aicommits icon indicating copy to clipboard operation
aicommits copied to clipboard

feat: Add option to prefix generated commit message

Open aslakhol opened this issue 2 years ago • 5 comments

This PR adds a flag --prefix to prefix a string to the generated commit message. It'll make it possible to use aicommits with many actual workflows while being very flexible and optional.

Example 1: For this commit i used aicommits --prefix feat: to use conventional commits which is used in this repo. I agree with the discussion in #17 that it would be cool to get GPT to generate the conventional commit tag, however this would work in the short term and is flexible enough to cover other needs as well. Having a separate flag for generated semantic versions is still possible and does not conflict with this.

Example 2: For a monorepo project I work on we usually prefix our commits with the relevant project if they only touch one project or vertical. In that case I could use aicommits --prefix web: to indicate that a commit is for the web project.

This resolves #111 and helps with #32, though still leaves room for work on that one.

aslakhol avatar Feb 24 '23 10:02 aslakhol

@Nutlope What is missing for this PR to be approved?

mreduar avatar Apr 30 '23 15:04 mreduar

Thanks for the PR!

Would you mind fixing the merge conflicts and linting error?

privatenumber avatar May 03 '23 14:05 privatenumber

Thanks for the PR!

Would you mind fixing the merge conflicts and linting error?

Just fixed the merge conflicts. There are a pile of linter warnings, but no errors. Seems like one of the warnings (max-params in aicommits.ts) is related to my change. Do you want me to wrap the params up in an object to avoid the warning or just leave it be @privatenumber ? The warning is also triggered in other files unrelated to my changes.

aslakhol avatar May 03 '23 14:05 aslakhol

It's true, there are several unrelated warnings image

mreduar avatar May 03 '23 15:05 mreduar

No worries about the warnings as long as the errors are addressed.

privatenumber avatar May 04 '23 00:05 privatenumber