frinyvonnick / gitmoji-changelog

A changelog generator for gitmoji 😜
https://www.npmjs.com/package/gitmoji-changelog
MIT License
390 stars 49 forks source link

Is it possible to prevent a section to be createad in the changelog? #244

Open gleisonkz opened 2 years ago

gleisonkz commented 2 years ago

Hy everybody, is there a way I can prevent the misc group section to be created ?

image

I tried to limit the emoji list on .gitmoji-changelogrc but it seems not to have any effect.

    {
      "group": "misc",
      "label": "Miscellaneous",
      "emojis": [
        "lipstick"
      ]
    }
kb05 commented 2 years ago

I am also interested in this topic, in my case I need that only a list of sections will be shown on the changelog (or in other words, prevent that the other sections being create).

I was researching the project code and it's seem that the "commitMapping" property it's a merge between the default group and the new ones (defined by the user), and It property almost could do the trick to get the behaviour that we want, for example if we override the "fix" group with the next information:

 "commitMapping": [
        {
            "group": "fixed",
            "label": "Fixed",
            "emojis": []
        }
    ]

we can remove the fixed section of the changelog, but all the elements that belongs to the fixed category will be shown on "misc" category, as the parser.js specify in the line 59: image

do you know how we can generate a changelog that only include a list of category groups?

sercanuste commented 1 year ago

Hi @gleisonkz. It's possible with custom group mapping. 'useless' group is filtered out before creating the changelog.

https://github.com/frinyvonnick/gitmoji-changelog/blob/584d0658294bd8e0d769fbdcc9905509cb892e17/packages/gitmoji-changelog-core/src/index.js#L48-L51

You need to create .gitmoji-changelogrc like following. When you change mapping, you need to remove old one.

{
    "commitMapping": [
        {
            "group": "changed",
            "label": "Changed",
            "emojis": [
                "art",
                "zap",
-               "lipstick",
                "rotating_light",
                "arrow_down",
                "arrow_up",
                "pushpin",
                "recycle",
                "wrench",
                "rewind",
                "alien",
                "truck",
                "bento",
                "wheelchair",
                "speech_balloon",
                "card_file_box",
                "children_crossing",
                "building_construction",
                "iphone"
            ]
        },
        {
            "group": "useless",
            "label": "Useless",
            "emojis": [
                "bookmark",
+               "lipstick"
            ]
        }
    ]
}

Default mapping is at https://github.com/frinyvonnick/gitmoji-changelog/blob/master/packages/gitmoji-changelog-core/src/groupMapping.js

sercanuste commented 1 year ago

By the way, I developed a filter for skipping changelog. You can use it with [skip cl] and [skip changelog] keywords after PR https://github.com/frinyvonnick/gitmoji-changelog/pull/251 merged.

You need to create .gitmoji-changelogrc like following.

{
+    "useSkipChangelog": true
}

And you can commit like following.

✨ Upgrade brand new feature [skip changelog]