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

Default changelog titles for cz_conventional_commits #1119

Open
paduszyk opened this issue May 16, 2024 · 9 comments · May be fixed by #1143
Open

Default changelog titles for cz_conventional_commits #1119

paduszyk opened this issue May 16, 2024 · 9 comments · May be fixed by #1143
Assignees
Labels
issue-status: wait-for-implementation maintainers agree on the bug / feature type: feature A new enhacement proposal

Comments

@paduszyk
Copy link
Contributor

Description

In general the Conventional Commits / Angular scheme is suitable for me (as for most of the people write code with VSC, I guess). It is nicely implemented in commitizen and suggested to be set as a default (see #535, comment). That's great!

The only thing I don't get is the way the changelog sections are formatted:

change_type_map = {
"feat": "Feat",
"fix": "Fix",
"refactor": "Refactor",
"perf": "Perf",
}

Is there any specific reason (or convention) for which the section titles are as they are?

Changelogs are supposed to be read by humans (?), so why more human-readable names aren't applied?

Regards! 🙂

Possible Solution

change_type_map = { 
     "feat": "Features", 
     "fix": "Bug fixes", 
     "refactor": "Code refactoring", 
     "perf": "Performance improvements", 
 } 

The change_type_order must be updated accordingly.

Additional context

I am aware of the fact that my issue can be resolved by cz_customize. This, however, requires providing extra configurations, e.g. bump_pattern, etc.

Additional context

No response

@paduszyk paduszyk changed the title Default changelog titled for cz_conventional_commits Default changelog titles for cz_conventional_commits May 16, 2024
@woile
Copy link
Member

woile commented May 17, 2024

Yeah me neither TBH, I'm open to it. @Lee-W @noirbizarre do you have any thoughts?

@Lee-W
Copy link
Member

Lee-W commented May 18, 2024

Looks good to me. But will we probably need to go to v4? somewhat a breaking change

@woile
Copy link
Member

woile commented May 18, 2024

I think even if it's exposing to the end user, it's not a breaking change. Functionality will remain the same.

@Lee-W
Copy link
Member

Lee-W commented May 18, 2024

I think even if it's exposing to the end user, it's not a breaking change. Functionality will remain the same.

I'm ok with it. Sound great!

@paduszyk
Copy link
Contributor Author

@Lee-W @woile I'm glad you guys are OK with it. I also don't see a breaking change in it.

I can open a PR if you don't mind... Just let me know whether the titles I have proposed are OK. Maybe, we should go with "New features", "Features added", or "New features added" instead of "Features".

@Lee-W
Copy link
Member

Lee-W commented May 19, 2024

Sounds great! I don't have a strong opinion on which one. Maybe we can take a look at how large open-source projects do. Assigning this to you. Thanks!

@Lee-W Lee-W added the type: feature A new enhacement proposal label May 20, 2024
@paduszyk
Copy link
Contributor Author

paduszyk commented May 24, 2024

As I just checked in my local fork, updating the titles breaks a lot of tests. This is because the old titles are hard-coded in the test changelogs. So, one way is to update the hard-coded titles. This would result in a large diff, however...

An alternative is to add (to the global conftest.py) a fixture that will preserve the old titles:

@pytest.fixture(autouse=True)
def default_change_type_map(mocker: MockFixture) -> None:
    mocker.patch.object(
        ConventionalCommitsCz,
        "change_type_map",
        {
            "feat": "Feat",
            "fix": "Fix",
            "refactor": "Refactor",
            "perf": "Perf",
        },
    )

This makes everything green.

@woile @Lee-W What do you think? I have some doubts. Should I auto use or use the fixture only for the tests that fail?

@paduszyk paduszyk linked a pull request May 24, 2024 that will close this issue
4 tasks
@Lee-W
Copy link
Member

Lee-W commented May 27, 2024

Sorry for late reply. I would prefer use the fixture only for the tests that fail

@woile
Copy link
Member

woile commented May 27, 2024

I'd rather have the tests fixed 🙏🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue-status: wait-for-implementation maintainers agree on the bug / feature type: feature A new enhacement proposal
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants