Skip to main content

Committing

info

We’re currently making rapid changes to the product so our docs may be out of date. If you need help, please email yo@forem.com.

Committing and pre-commit hooks

Commit messages

We encourage people to write meaningful commit messages.

Style guide

This project follows thoughtbot's Ruby Style Guide, using Rubocop along with Rubocop-Rspec as the code analyzer. If you have Rubocop installed with your text editor of choice, you should be up and running.

For the frontend, ESLint and prettier are used. ESLint's recommended rules along with Preact's recommended rules are used for code-quality. Formatting is handled by prettier. If you have ESLint installed with your text editor of choice, you should be up and running.

Husky hooks

When commits are made, a git precommit hook runs via husky and lint-staged. ESLint, prettier, and Rubocop will run on your code before it's committed. If there are linting errors that can't be automatically fixed, the commit will not happen. You will need to fix the issue manually then attempt to commit again.

Note: if you've already installed the husky package at least once (used for pre-commit npm script), you will need to run yarn --force or npm install --no-cache. For some reason, the post-install script of husky does not run when the package is pulled from yarn or npm's cache. This is not husky specific, but rather a cached package issue.