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 prevent a section to be createad in the changelog? #244

Open
gleisonkz opened this issue May 28, 2022 · 3 comments
Open

Comments

@gleisonkz
Copy link

gleisonkz commented May 28, 2022

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
Copy link

kb05 commented Jun 13, 2022

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
Copy link
Contributor

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

function filterCommits(commits) {
return commits
.filter(commit => commit.group !== 'useless')
}

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
Copy link
Contributor

By the way, I developed a filter for skipping changelog. You can use it with [skip cl] and [skip changelog] keywords after PR #251 merged.

You need to create .gitmoji-changelogrc like following.

{
+    "useSkipChangelog": true
}

And you can commit like following.

✨ Upgrade brand new feature [skip changelog]

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

No branches or pull requests

3 participants