di-sukharev / opencommit

Generate conventional git commit messages with AI in 1 second 🤯🔫
https://www.npmjs.com/package/opencommit
MIT License
5.98k stars 318 forks source link

FEAT: Support to enforce conventional commits, custom scopes and amend other tool commits #61

Open D4RKAR117 opened 1 year ago

D4RKAR117 commented 1 year ago

Hey, first of all awesome tool

I want to know if there is something about conventional commits (or any other preset like angular) into the tool, would be awesome for workflows that use extensively commit lint.

Also, there is some way that you can choose the scope? Would be great for monorepos where scopes usually belongs to the package that is being modified.

Finally, would be great if this tool can amend the commit after the manual writing of the commit, this could help for integration with other git tools like commitizen.

Keep the awesome work!!

di-sukharev commented 1 year ago

you can do oc --amend and all other git commit flags are also passed to oc. Sorry, I dont get your first 2 points :0

jakob1379 commented 1 year ago

@di-sukharev, just some context:

Tools like commitizen are widely used to make conventional commits for automating semantic versioning and changelogs. Currently, OC does not conform to conventional commits. You can find the specifications here.

The main issue a missing blank space between the first line describing header (type, scope, and subject) and the descriptive text.

D4RKAR117 commented 1 year ago

Yeah, by default some tools like monorepos use git scopes to automate releases of certain packages, so would be great that as @jakob1379 suggest, the AI uses conventional commits or any other git spec (like angular commits) or even custom specs to do their job, so tools that sues that spec don't fail, something like commitlint and that

di-sukharev commented 1 year ago

so you are saying that adding a blank space between header and description would solve the issue?

D4RKAR117 commented 1 year ago

It goes beyond that, usually projects use the following package to lint their commits using git hooks (husky), if the AI follow the specs configured at commitlint.config.js/ts file, and as @jakob1379 said the specification of conventional commits. That way, many workflows that implement the commit linting can use opencommit without major problems

dasheck0 commented 1 year ago

+1 this. I maintain multiple projects with their respective commit message style. It is not always conventional commits sometimes just plain english (what I dislike. But this is a different discussion altogether). However, it would be great if OC recognizes this and creates messages according to the commit style that is already present. As far as I know one can send this is further context for GPT-3.5. I suppose that last n commits are sufficient as well, so that you don't have to send the while history for this to work.

di-sukharev commented 1 year ago

could anybody help me here please and make the PR? <3

dasheck0 commented 1 year ago

I can take a look it this. Not sure when I get to it. Probably this weekend

sebastienfi commented 1 year ago

+1 this. I maintain multiple projects with their respective commit message style. It is not always conventional commits sometimes just plain english (what I dislike. But this is a different discussion altogether). However, it would be great if OC recognizes this and creates messages according to the commit style that is already present. As far as I know one can send this is further context for GPT-3.5. I suppose that last n commits are sufficient as well, so that you don't have to send the while history for this to work.

I'd rather have a config to define the style, because previous commit messages might be flawed. Yet enhancing prompt with previously correct commit messages could be a nice option.

sebastienfi commented 1 year ago

I'm working on this, I will submit a PR soon.

sebastienfi commented 1 year ago

@D4RKAR117 @jakob1379 @dasheck0 Could you please review the PR and provide feedback?

github-actions[bot] commented 1 year ago

Stale issue message

di-sukharev commented 7 months ago

@sebastienfi hi, are we done here or should i reopen?

di-sukharev commented 7 months ago

ok, i see <3