Skip to content

Contributing: Commit Message Syntax

Jonathan Niles edited this page May 6, 2016 · 4 revisions

The purpose of commit messages are to help developers understand the project history, particularly when trying to find the introduction of a bug. Commit messages also form the most basic form of feature documentation. These guidelines are meant to help developers write commit messages that are clear, helpful, and easy to navigate.

Commit Message Template

The basic template of a commit message should look like this: <type>(<scope>): <subject>. This is based off the angularjs commit message guidelines.

  1. <type> The type of a commit message should fit in one of the following:
  2. docs - a commit made to adjust documentation. This can be improvements, rewrites, additions, or removals.
  3. deps- a commit made to adjust dependencies. This commit should always change package.json or bower.json.
  4. fix - introduce a fix for a test case or bug reported via the issue tracker.
  5. feat - introduce a new feature to the application.
  6. test - add missing test cases, or update old ones.
  7. chore - a miscellaneous task that does not fit in the above. Importantly, it should not change the application's feature set or add additional dependencies.
  8. <scope> Indicate the components affected. If this commit affects many modules, do not indicate a scope. If the commit affects a component/module, use the module name.
  9. <subject> A short (< 70 characters) description of the changes in the commit.

Including more detail is always better than a single line. To describe the changes, leave one newline between the commit header and the following descriptions. These can be any number of lines or paragraphs. The text should be written as either plain text or in markdown syntax. Always limit columns to 80 characters.

Examples

# This commit changes many client-side modules, re-writing 
# documenation in jsdoc syntax
docs: migrate client to jsdoc syntax

# This commit adds a new database schema
feat(db): create a bank entity

# This commit has a long description
test(auth): add missing client /logout tests

This commit adds integration tests for the /logout route on the
server.  Only logged in users are allowed to logout, and error
cases (unable to destroy user session) is handled via HTTP status
codes.

# This commit adds translation keys
chore(i18n): translate missing fr.json keys