Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Add Choice [ chore, revert ] to question "Select the type of change you are committing" #36

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

Closed
Singein opened this issue Aug 10, 2019 · 3 comments

Comments

@Singein
Copy link

Singein commented Aug 10, 2019

chore: Other changes that don't modify src or test files
revert: Reverts a previous commit

@Singein
Copy link
Author

Singein commented Aug 10, 2019

thx for your amazing work about this project!
I used to use the commitzen tool in nodejs, so I always hope that there is such a tool in Python. I originally wrote a very simple string concatenation script. Now I finally saw your project. It is really exciting.

@woile
Copy link
Member

woile commented Aug 11, 2019

I'm glad you like it :)

I don't want to bloat a lot the current conventional commits. It's using the latest version of conventional commits with elements from angular. And they don't include revert or chore, I think the latest has been removed because of people were confusing a lot.

I recommend creating a custom cz with those extra types.

Something along the lines:

from commitizen.cz.conventional_commits import ConventionalCommitsCz

class CustomCC(ConventionalCommitsCz):
    def questions(self):
        questions = super().questions()
        questions[0]["choices"] = [
                    {
                        "value": "fix",
                        "name": "fix: A bug fix. Correlates with PATCH in SemVer",
                    },
                    {
                        "value": "feat",
                        "name": "feat: A new feature. Correlates with MINOR in SemVer",
                    },
                    {"value": "docs", "name": "docs: Documentation only changes"},
                    {
                        "value": "style",
                        "name": (
                            "style: Changes that do not affect the "
                            "meaning of the code (white-space, formatting,"
                            " missing semi-colons, etc)"
                        ),
                    },
                    {
                        "value": "refactor",
                        "name": (
                            "refactor: A code change that neither fixes "
                            "a bug nor adds a feature"
                        ),
                    },
                    {
                        "value": "perf",
                        "name": "perf: A code change that improves performance",
                    },
                    {
                        "value": "test",
                        "name": (
                            "test: Adding missing or correcting " "existing tests"
                        ),
                    },
                    {
                        "value": "build",
                        "name": (
                            "build: Changes that affect the build system or "
                            "external dependencies (example scopes: pip, docker, npm)"
                        ),
                    },
                    {
                        "value": "ci",
                        "name": (
                            "ci: Changes to our CI configuration files and "
                            "scripts (example scopes: GitLabCI)"
                        ),
                    },
                   {
                        "value": "chore",
                        "name": "Other changes that don't modify src or test files"
                    },
                   {
                        "value": "revert",
                        "name": "Reverts a previous commit"
                    },
                ],
        return questions


discover_this = CustomCC

@Singein
Copy link
Author

Singein commented Aug 13, 2019

Received, I think what you said makes sense.

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

2 participants