vivaxy / vscode-conventional-commits

💬Conventional Commits for VSCode.
https://marketplace.visualstudio.com/items?itemName=vivaxy.vscode-conventional-commits
MIT License
323 stars 35 forks source link

[FEAT] Add common messages to vscode's settings.json #338

Open movahhedi opened 6 months ago

movahhedi commented 6 months ago

Add a [configurable] prompt for choosing between common commit messages defined in vscode's settings.json (just like how we define scopes in it).

vivaxy commented 6 months ago

Hi, @movahhedi. Thanks for the good question. In my situation, commit message representing the exact changes I've made to the repo. Commits with same commit message will be squashed into one. I'm not familiar to your situation. Is it possible to provide more detailed use cases related to this feature?

movahhedi commented 6 months ago

Some commit messages are commonly used, like when updating dependencies. I have these scopes defined in my .vscode/settings.json:

{
    "conventionalCommits.scopes": ["client", "server", "deps"],
}

I suggest adding a commonMessages & showCommonMessages key:

{
    "conventionalCommits.scopes": ["client", "server", "deps"],
    "conventionalCommits.showCommonMessages": true,
    "conventionalCommits.commonMessages": [
        {
            "message": "style: lint & format",
            "desc": "Applied lints & formatted code"
        },
        {
            "message": "chore(deps): update dependencies",
            "desc": "Updated dependencies"
        },
        {
            "message": "chore: update yarn",
            "desc": "Updated Yarn version"
        },
    ],
}

And if showCommonMessages was true, adding a dialog at the start of the commit questions, to choose from the defined messages in commonMessages.