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

Is it possible to configure the sections created in the changelog? #154

Closed
ivanhercaz opened this issue Dec 10, 2019 · 5 comments · Fixed by #155
Closed

Is it possible to configure the sections created in the changelog? #154

ivanhercaz opened this issue Dec 10, 2019 · 5 comments · Fixed by #155
Labels
enhancement New feature or request

Comments

@ivanhercaz
Copy link

ivanhercaz commented Dec 10, 2019

Hi everyone,
First of all, thank you for your work with gitmoji-changelog. It is a very useful and interesting tool. I really like it. But I want to know if there is some way to configure the way in which it works. I want to customize the sections in which it adds the commits.

For example, I would like to have a section for Documentation and Internationalization/localization. These sections would be filled with the commits with:

  • Documentation. 📝 (:pencil:) and 💡 (:bulb).
  • Internationalization/localization. 🌐 (:globe_with_meridians:).

After read the gitmoji-changelog I understand this should be configured in a preset, but if it is true, I admit that I don't understand how I could configure it.

P.S. I haven't tested it now but, gitmoji-changelog adds a specific section for the breaking changes? I mean if there are commits with 💥 (:boom:).

@frinyvonnick
Copy link
Owner

frinyvonnick commented Dec 10, 2019

Hi @ivanhercaz, thank you for posting this feature request 🙏

I made an implementation proposal in PR #155.

How it works:

You need to create a .gitmoji-changelogrc in your project folder with the following content:

{
  "commitMapping": [
    {
      "group": "documentation",
      "label": "Documentation",
      "emojis": [
        "pencil",
        "bulb",
      ]
    },
    {
      "group": "internationalization",
      "label": "Internationalization/localization",
      "emojis": [
        "globe_with_meridians"
      ]
    },
  ]
}

It will now only handle these two categories with commits using pencil, bulb and globe_with_meridians.

You will need to start from the actual mapping to cover all kind of commits.

Questionning

I'm asking myself if the system should override totally or partially the original mapping. So users can just add new categories without having the whole mapping in his configuration file. What are your thoughts about it @ivanhercaz @bpetetot?

In this case if a emoji has already a category in the default mapping you will have to override this category too so you can remove this emoji from it. In case an emoji is present in two categories what should we do?

@ivanhercaz
Copy link
Author

ivanhercaz commented Dec 10, 2019

Awesome! You have been very fast, @frinyvonnick! 🚀 Thank you very much for the implementation of this feature.

About the questioning. I think the system should override partially the original mapping, because, at least in my case and in this moment, I am agree with the current mapping but I just want to specify some type of commits (like the examples given).

In this case if a emoji has already a category in the default mapping you will have to override this category too so you can remove this emoji from it.

So, for example, if I want to add 🔥 (:fire:) to "changed", must I rewrite both groups (changed and removed)? Or, in another case, if I want to 🚀 (:rocket) to "added", must I rewrite all the group with the values from the default mapping if I want to keep the another values?

In case an emoji is present in two categories what should we do?

For me it would be more useful to clarify that an emoji can be just in one category. If you know cases in which it might be in both, or there may be people interested in that, I think it should be added in the first of the two categories, but this would be like to have the emoji just in one category. Another possible solution could be to add the commit in both categories, but I don't if it would be correct or not to have a duplicated entry in different categories. I think it wouldn't be agree with conventional changelogs.

Again, thank you for your work!

P.S. Really awesome to see you working on gitmoji-changelog!

@frinyvonnick
Copy link
Owner

Thank you for your reply @ivanhercaz!

So, for example, if I want to add 🔥 (:fire:) to "changed", must I rewrite both groups (changed and removed)? Or, in another case, if I want to 🚀 (:rocket) to "added", must I rewrite all the group with the values from the default mapping if I want to keep the another values?

It sounds great to override whole categories as you described. If you override partially categories it wont let you remove emojies from a category. In fact you will have to copy paste default mapping in categories you override if you want to just add a new emoji. In case of moving emoji from a category to another you sure have to override both and copy default mapping as you described.

I can't find a better solution. Does it seems fine to you?

@frinyvonnick frinyvonnick added the enhancement New feature or request label Jan 3, 2020
@frinyvonnick
Copy link
Owner

frinyvonnick commented Jan 5, 2020

I made a first version following my previous comment @ivanhercaz. Feel free to open a new issue if you want improvements on this 👍

You can test it using canary version. I'll publish as soon as possible.

@ivanhercaz
Copy link
Author

Thank you a lot for your work @frinyvonnick! I will test it as soon as possible with the canary version, but not from the Canary Islands (just a bad joke because I am from 🇮🇨 🤣 ).

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