[Archived] Conventional Commits Guideline - MindVista/website GitHub Wiki

[!NOTE] This page has been archived as of #172. We no longer enforce the guidelines below. You are of course free to continue to follow them, but we no longer require it. Why? Our use case for the Conventional Commits style doesn't allow us enough flexibility. For the new, simplified, more relaxed guidelines, see our revised Commit Guidelines.

Conventional Commit Guidelines

This repository follows modified a conventional commit guide to keep our commit history clear and structured. Here are the commit types to use:

Commit Types

Type Description Example
build Changes that affect the build system or dependencies. build: update to latest mindfulness package
ci Changes to continuous integration setup, like configuration files. ci: add deployment workflow for GitHub Actions
cms Changes to Payload CMS configuration and the like. cms: add new pages collection
test Adding or modifying tests (unit tests, E2E tests, etc.). test: add e2e test for contact form submission
merge Represents any git merge. merge: branch 'master' into about-page
content Adding, updating, or removing website content (text, images, etc.). content: update About Us page
feat A new feature or functionality added to the website. feat: add search bar to the navigation
fix A bug fix, including broken links, layout issues, or code bugs. fix: resolve mobile menu not opening on small screens
resp Changes to improve responsive design. resp: decrease side margins for smaller devices
a11y Accessibility improvements to enhance website usability. a11y: add alt text to all homepage images
ui Visual changes to the site’s appearance (e.g., colors, fonts, spacing adjustments). ui: change button color to match theme
ux Changes made to improve user experience (e.g., adding loading states). ux: add nextjs-toploader
perf Changes made to improve website performance (e.g., optimizing images or code). perf: lazy-load images on about us page
sec Changes made to fix vulnerabilities or improve security. sec: define explicit permissions for github action
refactor Code restructuring or cleaning that doesn’t change any functionality. refactor: reorganize header component files
seo Changes to improve search engine optimization. seo: update meta descriptions for mental wellness page
legal Updates to legal documents, like privacy policies or terms of service. legal: update privacy policy to include new data use clause
docs Documentation changes, such as README updates, guidelines, or other informational files. docs: add commit guidelines for contributors
other If you must... other: go on a relaxing stroll in outremont

Selective Scopes

The build type specifically may accept no scope, scope deps, or scope deps-dev.

Example Usage

  • Adding a New Page: feat: add a contact page with form
  • Changing Colors on Buttons for Consistency: ui: update primary button color across site
  • Fixing Broken Link: fix: correct link in footer to redirect to new policy page
  • Improving Page Load Speed: perf: compress splash images to improve load time
  • Making Images More Accessible: a11y: add captions to staff photos
  • Updating Privacy Policy: legal: update privacy policy to reflect data protection laws

General Rules

  • Atomic Commits: Each commit should represent a single, specific change, to the best of your ability.
  • Message Clarity: Ensure commit messages clearly state what the change is.
  • Message Length: Try to limit commit messages to under 50 characters if possible, but do not sacrifice clarity to meet said limit. (some of the examples above use more than 50 characters!)
  • Descriptions: Descriptions are...a free for all...for right now. Ensure clarity and concision nevertheless.
  • Scope: Use lowercase, concise scopes if you want to specify a particular section (e.g., feat(nav): add dropdown menu).

Husky

These commit guidelines are remotely enforced and deployment will be blocked if conventions are not adhered to.

To prevent "bad" commit messages from reaching the remote server in the first place, we use Husky to run commitlint on every commit attempt. Husky is already installed locally as a dev dependency when you clone this repo.

You do not need to take any action here, but be aware of what is going on here and do not modify anything in /.husky/.

If you would like to add additional commit types, you may edit /.commitlintrc.ts, and of course remember to update the documentation here. You should however, not have to do this. Take caution.