Skip to content

A python program that helps you write commits following commit conventions (fork of the original)

License

Notifications You must be signed in to change notification settings

JohnDevlopment/commit-helper

 
 

Repository files navigation

Commit Helper

Commit Helper

Build Status Maintainability codebeat badge Codacy Badge

What does it do?

The commit-helper do exactly what it’s name suggest: helps you create and maintain your commit policy by tailoring your commit message into a commit convention.

Why should I use this?

Keeping a commit policy may sound like an easy thing to do, but in reality we both know that it isn’t.

Sometimes we, the developers, go full-loco while programming and make mistakes when commiting. That’s fine, everyone makes mistakes. But, what if those mistakes could be avoided?

Screenshots

Cannot load image gifs/generate-file.gif

Normal commit

Cannot load image gifs/commit.gif

Commit without generating a configuration file

Cannot load image gifs/--no-file.gif

Co-authored commit

Cannot load image gifs/co-author.gif

Fast commit

Cannot load image gifs/single-line.gif

Debugging and commiting

Cannot load image gifs/--debug.gif

All-in-one commit

Cannot load image gifs/all.gif

Help

Cannot load image gifs/flag-h.gif

Getting help for writing in a convention

Cannot load image gifs/tag-help.gif

Installation

In order to install one of our older versions, check our [previous releases](PREVIOUS_VERSIONS). To install the latest (pip) version, just follow the commands below:

$ pip3 install commit-helper

Updating your current version

If you already have one of our pip releases installed in your machine and want to update to the latest version, use the command:

$ pip3 install --upgrade commit-helper

Usage and configuration

This program has a cli that you can take advantage of. Running commit --help will show you the usage and options for your commit. All of them are optional for the sake of not losing your precious time.

$ commit -h
usage: commit [-h] [-t TAG] [-m MESSAGE] [-ct CONTEXT] [-ca CO_AUTHOR] [-nf]
              [-c {angular,karma,tagged,symphony,message,atom,john}] [-d] [-s]

A commit formatter tool to help you follow commit conventions.

options:
  -h, --help            show this help message and exit
  -t TAG, --tag TAG     Pass your commit tag directly
  -m MESSAGE, --message MESSAGE
                        Pass your commit message directly
  -ct CONTEXT, --context CONTEXT
                        Pass your commit context directly
  -ca CO_AUTHOR, --co-author CO_AUTHOR
                        Make your friend an co-author to the commit
  -nf, --no-file        Disables the creation of a commiter.yml file
  -c {angular,karma,tagged,symphony,message,atom,john}, --convention {angular,karma,tagged,symphony,message,atom,john}
                        Selects a convention to be used for the commit. Required if there's no commiter.yml file.
  -d, --debug           Toggles debug option
  -s, --show            Shows the rules of a given convention

So, if you want to write a co-authored commit, you should use:

$ commit --co-author "foo bar doritous <foobar@douritos.com>"

Or if you are using this for the first time in your project:

$ commit --convention tagged

To work even more smoothly, have in your working directory a file named commiter.yml or commit-helper.yml. In this file you must pass the commit convention that you want to use, following the example:

convention: angular   # tag(context): commit message

# or

convention: karma   # tag(context): commit message

# or

convention: tagged # TAG: commit message

# or

convention: symphony  # [Tag] commit message

# and if you're feeling adventurous

convention: none      # Commit message

In case that you or your organization does already have a commit convention that is not listed above, you can configure it in the commiter.yml or commit-helper.yml file as following:

convention: custom
# considering a commit message like '{add} (stuff) ~> in file foo.br'
commit_pattern: '{tag} (context) ~> message'
# tag, message and context are reserved words that will be replaced in your commit message
context: true # this is a must have field! If your pattern doesn't have one, assign false to it

Supported conventions available:

  • angular

  • karma

  • tagged

  • symphony

  • atom

  • john

  • only message (no convention)

  • a custom one that you may create :)

Troubleshooting

If after you’ve installed commit-helper the commit or commit-helper commands are not usable at the command line, check if $HOME/.local/bin is on your PATH. If not, add it on your .bashrc file by running:

$ echo "export PATH=$HOME/.local/bin:$PATH" >> .bashrc

Project’s maintainers

Name Username Relationship to repo

André de Sousa Costa Filho

@andre-filho

original author

John Russell

@JohnDevlopment

fork author

Their collaborators

Collaborators from the original repository.

Name Username

Arthur José Benedito de Oliveira Assis

@arthur0496

Matheus Richard Torres Gomes de Melo

@MatheusRich

About

A python program that helps you write commits following commit conventions (fork of the original)

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Languages

  • Python 98.9%
  • Shell 1.1%