Skip to content

Contributing

Thomas Roux edited this page Aug 23, 2018 · 1 revision

Contributing

Submitting a Pull Request

  1. Make your changes in a new git branch:

    git checkout -b feat/my-new-feature-name
  2. Test your changes to the best of your ability and ensure that all tests pass.

  3. Update the documentation to reflect your changes if they add or changes current functionality.

  4. Commit your changes using a descriptive commit message that follows our commit message conventions. Adherence to the commit message conventions is required because release notes are automatically generated from these messages.

     git commit -a

    Note: the optional commit -a command line option will automatically "add" and "rm" edited files.

  5. Push your branch:

    git push origin feature/my-new-feature
  6. Create new Pull Request

That's it! Thank you for your contribution!

After your Pull request is merged

After your Pull request is merged, you can safely delete your branch and pull the changes from the master:

  • Delete the remote branch either through the GitLab web UI or your local shell as follows:

    git push origin --delete feat/my-new-feature
  • Check out the master branch:

    git checkout master -f
  • Delete the local branch:

    git branch -D feat/my-new-feature
  • Update your master with the latest origin's version:

    git pull --ff origin master

Git Commit Guidelines

We have very precise rules over how our git commit messages can be formatted. This leads to more readable messages that are easy to follow when looking through the project history. But also, we use the git commit messages to generate the change log.

Commit Message Format

Each commit message consists of a header, a body and a footer. The header has a special format that includes a type, a scope and a subject:

<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>

The header is mandatory and the scope of the header is optional.

Any line of the commit message cannot be longer 100 characters! This allows the message to be easier to read in various git tools.

Revert

If the commit reverts a previous commit, it should begin with revert: , followed by the header of the reverted commit. In the body it should say: This reverts commit <hash>., where the hash is the SHA of the commit being reverted.

Type

Must be one of the following:

  • feat: A new feature
  • fix: A bug fix
  • 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
  • chore: Changes to the build process or auxiliary tools and libraries such as documentation generation

Scope

The scope could be anything specifying place of the commit change. For example home, webpack etc...

Subject

The subject contains succinct description of the change:

  • use the imperative, present tense: "change" not "changed" nor "changes"
  • don't capitalize first letter
  • no dot (.) at the end

Body

Just as in the subject, use the imperative, present tense: "change" not "changed" nor "changes". The body should include the motivation for the change and contrast this with previous behavior.

Footer

The footer should contain any information about Breaking Changes and is also the place to reference issues that this commit Closes.