Skip to main content

Commits

This document describes our best practices when writing commits to contribute to CRUK repos

info

The following content is recommended.

Rationale​

It is important to have the "why" something changed as this is very helpful for future engineers.

Description​

  1. The commit statement needs to be important.
  2. Include any helpful links such as JIRA tickets, UI references, GitHub issues or external resources.
  3. If needed, include a commit body explaining details of the "why" that might be otherwise missed in a short commit message
  4. You might find useful to use a helper tool such as commitizen which can be used to prefix the commit message with a one-word description of the nature of the commit e.g. fix, feat, test, etc.
  5. If at all possible, each repository should have a CONTRIBUTION.md file that details how to contribute.

Examples​

Commit Messages that follow the convention: ✔️

AM-1595 Remove X-Powered-By: PHP header
Highlighted in a security report and advised to be
removed as this is information that may aid attackers.
JIRA https://jira.cancerresearchuk.org/browse/AM-1595
fix: move parseHTML to single access point
Adds renderCustomText as the
single point for the rendering of custom HTML
or Markdown text into react components.
JIRA https://jira.cancerresearchuk.org/browse/AM-1604

Commit Messages do not follow the convention: ❌

fix bad code update change change the class

References & Further Reading​