aicommits
aicommits copied to clipboard
feat: Add option to prefix generated commit message
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.
@Nutlope What is missing for this PR to be approved?
Thanks for the PR!
Would you mind fixing the merge conflicts and linting error?
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.
It's true, there are several unrelated warnings
No worries about the warnings as long as the errors are addressed.