conventional-changelog-archived-repos / validate-commit-msg

DEPRECATED. Use https://github.com/marionebl/commitlint instead. githook to validate commit messages are up to standard
http://conventionalcommits.org/
MIT License
557 stars 100 forks source link

Configurable commit scopes #100

Closed anrie closed 6 years ago

anrie commented 7 years ago

Hey,

we are currently trying to improve the quality of our commit messages and settled on an approach similar to this one: https://dev.bleacherreport.com/how-we-use-commitizen-to-clean-up-commit-messages-a16790dcd2fd

One remaining issue is the validation of our scopes: While there seems to be some standardization, when it comes to types (https://github.com/commitizen/conventional-commit-types), there doesn't seem to be an equivalent when it comes to scopes. Obviously scopes vary a lot more than types, but what would be great, would be a mechanism so that all tools in the ecosystem read the scopes from the same place/config.

So for example validate-commit-msg uses its own config setting (https://github.com/conventional-changelog/validate-commit-msg#allowed) while tools/adapters like cz-customizable have another config https://github.com/leonardoanalista/cz-customizable#options

That said ... did I eventually miss a solution to the problem? And if not, do you have an idea how to address this?

Would it be an idea to use a conventional-changelog-option in the package.json file to define the scopes for a project, that all interested libs can refer to?

  "config": {
    "conventional-changelog": {
       "scopes": ['scope-a", "scope-b"]
    }
  } 
Garbee commented 7 years ago

Doesn't the scope configuration option handle this case already? I added it a few months ago so you may need to update if you haven't done so in a while.

anrie commented 7 years ago

Hm, as far as I can see I am using the latest version and as I said I am well aware of the option to define allowed scopes in validate-commit-msg.

My question was more about an option to reuse the scope definition across different libs in the conventional-changelog ecosystem. Basically I'd like to define my scopes once and not again for every lib.

But I guess that's hard to solve from within a single lib as it's more about the interplay of the different libs. So my best bet at the moment seems to be to go ahead an fork cz-changelog, so that it can read the available scopes from the config of validate-commit-msg.

Garbee commented 7 years ago

ah ok. That is an interesting meta discussion about the ecosystem as a whole.

cc @stevemao

I think we could handle it easily enough if we abstracted getting the root config piece into its own sub-package for everyone to share. That way the code to get the shared config is shared and only maintained in one place. At that point we'd just merge where needed into the internal configs for each project.

stevemao commented 7 years ago

https://github.com/conventional-changelog/conventional-changelog/pull/146 maybe a good place to start

hutson commented 6 years ago

This package has been deprecated. Please use https://github.com/marionebl/commitlint instead.