ccgen

conventional commits generator (ccgen)

ccgen is a command-line tool that helps you create commit messages that adhere to the Conventional Commits specification. The tool allows you to interactively build commit messages, ensuring consistency and clarity in your version control history.

networking = Changes to backend logic

features

installation

To use the Conventional Commits Generator, simply download the ccgen.py script and place it in your project directory.

configuration

The tool uses a configuration file ccgen.ini to define custom commit types and scopes. You can generate a default configuration file by running the following command:

    python ccgen.py generate-config

This will create a ccgen.ini file with the following default commit types:


[types]
docs = Documentation only changes
style = Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc.)
refactor = A code change that neither fixes a bug nor adds a feature
perf = A code change that improves performance
test = Adding missing tests or correcting existing tests
build = Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
ci = Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
chore = Other changes that don’t modify src or test files
revert = Reverts a previous commit

[scopes]
ui = Changes to the user interface
backend = Changes to backend logic
api = Changes to the API
cli = Changes to the CLI
docs = Changes to documentation

Note: The commit types feat and fix are always available by default and do not need to be included in the configuration file.

usage

To generate a commit message interactively, use the following command:

python ccgen.py commit

This command will prompt you to enter the following information:

example

Here's an example of how the tool might be used:

python ccgen.py commit

# Prompts and Responses:
Select the type of change you are committing (type 'help' for more info): feat
Enter the scope of the change (optional, leave empty to skip): ui
Enter a short description of the change: Add new color theme to the UI
Enter a longer description of the change (optional, leave empty to skip): 
Does this commit introduce breaking changes? (y/n): n
Reference any issues this commit closes (optional, leave empty to skip): #42

# Generated Commit Message:
feat(ui): Add new color theme to the UI
Closes: #42
    

command-line options

The script supports the following commands:

configuration file format

The configuration file (ccgen.ini) is divided into sections:

Example:

[types]
docs = Documentation only changes
style = Changes that do not affect the meaning of the code

[scopes]
backend = Changes to backend logic
api = Changes to the API


edit this page