Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support multiple scopes #85

Closed
martinp7 opened this issue Jan 10, 2024 · 3 comments · Fixed by #86
Closed

Support multiple scopes #85

martinp7 opened this issue Jan 10, 2024 · 3 comments · Fixed by #86
Labels
enhancement New feature or request

Comments

@martinp7
Copy link
Contributor

Sometimes it is convenient to specify multiple scopes in a commit message e.g. feat(pkg1,pkg2): add some feature.

Current behaviour with v3.0.0

The following command is raising an error:

git commit -m "feat(pkg1,pkg2): add new feature"
Error
[Bad Commit message] >> feat(pkg1,pkg2): add new feature

        Your commit message does not follow Conventional Commits formatting
        https://www.conventionalcommits.org/

        Conventional Commits start with one of the below types, followed by a colon,
        followed by the commit subject and an optional body seperated by a blank line:

            ci build docs feat fix perf refactor style test EXP

        Example commit message adding a feature:

            feat: implement new API

        Example commit message fixing an issue:

            fix: remove infinite loop

        Example commit with scope in parentheses after the type for more context:

            fix(account): remove infinite loop

        Example commit with a body:

            fix: remove infinite loop

            Additional information on the issue caused by the infinite loop

Expected behaviour

If the scopes are comma separated, the commit message should be considered as valid ✅


This is something supported by other tools to validate commit message e.g. conventional-changelog/commitlint#901

@thekaveman
Copy link
Member

Thank you for the suggestion @martinp7!

In reading the Conventional Commits spec around scopes:

  1. A scope MAY be provided after a type. A scope MUST consist of a noun describing a section of the codebase surrounded by parenthesis, e.g., fix(parser):

I see nothing that explicitly forbids multiple scopes, and we already support scope separators like , /, -, and : -- so I see no reason why we can't also support ,.

A PR for this change would be most welcome!

@thekaveman thekaveman added the enhancement New feature or request label Jan 10, 2024
@martinp7
Copy link
Contributor Author

martinp7 commented Jan 10, 2024

Thanks for the answer, I was not aware that other separators were supported, I can implement the support for , 👌

@thekaveman
Copy link
Member

Thanks again for your work on this @martinp7.

3.1.0 has been released in GitHub and PyPI with this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants