commitizen / cz-conventional-changelog

A commitizen adapter for the angular preset of https://github.com/conventional-changelog/conventional-changelog
MIT License
766 stars 441 forks source link

Add other flavours as prompt #10

Open biegl opened 8 years ago

biegl commented 8 years ago

At the moment you are using the angular way of writing commit messages. Wouldn't it be an idea to configure what flavour (angular, atom, eslint, ember, jquery, jshint) should be used as prompt. This could be configured via package.json for example.

jimthedev commented 8 years ago

Hi @biegl. You are correct. The commitizen cli is designed to allow the exact feature that you're asking about. This repository is for the de-facto Angular adapter, but there are others too. We use adapters to allow people to choose their own flavors/conventions. Creating a new adapter is as simple as forking on of the existing adapters (like this repo) and modifying it to your needs.

The goal of commitizen is that the owner of the repo being worked on can choose an adapter that suits them and their server side commit hooks. It is the adapter that defines the rules (flavor) of the prompts. So, if you're working on an Angular repo, then that project maintainer would select this project, the cz-conventional-changelog adapter since that is the default for the Angular community.

If, alternatively, you're using a project that uses Jira, then the project maintainer might want to be specific to Jira's smart commit syntax and they'd select cz-jira-smart-commit as their adapter.

So if ember, jquery or other projects have conventions that they follow, one would just need to:

  1. Fork this repository
  2. Make changes.
  3. Push their new adapter to npm
  4. In their actual framework or app repo, they'd add that adapter using npm install cz-jquery-convention --save --save-exact and then adding the path to their adapter to the czConfig.

I'm not familiar with the conventions of those other projects but if you or others create adapters then I'd be happy to pull them into this github organization and add people as admins to those repos.

Thanks for bringing this up and let me know if I can be more clear.

jimthedev commented 8 years ago

Another adapter currently being developed is: https://github.com/rebelliard/rb-conventional-changelog

I think my goal needs to be to make the docs much more clear and well documented. One section titled 'Existing Adapters' containing a list of current known adapters. The second would be a 'How to create an adapter' section. How does that sound?

biegl commented 8 years ago

Hi @jimthedev, sounds very cool. At first I thought that your intention was to implement the prompts based on ajoslin's repo (https://github.com/ajoslin/conventional-changelog/tree/master/conventions). There are the other flavours that conventional-changelog supports. So I thought, if conventional-changelog supports more than the angular flavour, why not cz-conventional-changelog.

Nevertheless, I think it is a great idea to add a "how to" to the readme as well as a list of related adapters.

jimthedev commented 8 years ago

Ah, I see what you're talking about! That looks like a new feature so perhaps we can model additional adapters off of those formats. Thanks!! On Wed, Oct 14, 2015 at 3:58 PM Markus Bürgler notifications@github.com wrote:

Hi @jimthedev https://github.com/jimthedev, sounds very cool. At first I thought that your intention was to implement the prompts based on ajoslin's repo ( https://github.com/ajoslin/conventional-changelog/tree/master/conventions). There are the other flavours that conventional-changelog supports. So I thought, if conventional-changelog supports more than the angular flavour, why not cz-conventional-changelog.

Nevertheless, I think it is a great idea to add a "how to" to the readme as well as a list of related adapters.

— Reply to this email directly or view it on GitHub https://github.com/commitizen/cz-conventional-changelog/issues/10#issuecomment-148198481 .