CodeGPT icon indicating copy to clipboard operation
CodeGPT copied to clipboard

Provide option to support optional scope in conventional commits

Open hongbo-miao opened this issue 2 years ago • 3 comments

Thanks for https://github.com/appleboy/CodeGPT/issues/9

It would be great to support the optional scope in conventional commits too! 😃

hongbo-miao avatar Mar 09 '23 07:03 hongbo-miao

@Hongbo-Miao CodeGPT will generate conventional commits by default now so I don't know what you mean optional scope?

appleboy avatar Mar 09 '23 09:03 appleboy

Take docs(readme): improve OpenAI API Key setup process for example, in this commit message, (readme) is scope. https://www.conventionalcommits.org/en/v1.0.0/#commit-message-with-scope

hongbo-miao avatar Mar 09 '23 09:03 hongbo-miao

Renovate may give some ideas.

In a mono repo, it is common to provide this as a Renovate config

semanticCommitScope: '{{#if parentDir}}{{parentDir}}{{else}}deps{{/if}}'

This means by default it is using the each sub project folder name as scope. However, if it is root folder, it uses default deps as scope (as Renovate only updates dependencies which make sense to use deps as default scope in root folder). So the commits looks like

image

For non-mono repo, it is even harder to provide a good scope for sure. Maybe only docs(readme) is easy. Unfortunately, I don't have a good idea for the rest. 🤔

hongbo-miao avatar Mar 09 '23 09:03 hongbo-miao