* Improve format and clarity of the docs [ci skip] While this change produces a lot of git noise by enacting what seems like an arbitrary linewrap on most of the files in the documentation it will result in better version control and tracking of the changes in the documentation. For example, as it currently stands, if one was to make a PR to move a comma in a sentence because each paragraph in most of the files is on a single line, that small change would look in the git history like the author had modified the entire paragraph. In reality, this author just moved a comma. This change also includes a significant number of modifications to the more article-esque docs. Many of these docs were written in a sort of stream-of-conciousness and aren't as easy to read as they could be. Hopefully this is the first of several readability changes. If we could get these docs to a more accessible reading level, we would probably see an increase in contributions. :) * Delegate markdown wrapping to Prettier * Add linewrapping explanation in the docs [ci skip]
34 lines
1.5 KiB
Markdown
34 lines
1.5 KiB
Markdown
---
|
|
title: Committing
|
|
---
|
|
|
|
# Committing and pre-commit hooks
|
|
|
|
## Style guide
|
|
|
|
This project follows [thoughtbot's Ruby Style
|
|
Guide](https://github.com/thoughtbot/guides/blob/master/style/ruby/.rubocop.yml),
|
|
using [Rubocop](https://github.com/bbatsov/rubocop) along with
|
|
[Rubocop-Rspec](https://github.com/backus/rubocop-rspec) as the code analyzer.
|
|
If you have Rubocop installed with your text editor of choice, you should be up
|
|
and running.
|
|
|
|
For Javascript, we follow [Airbnb's JS Style
|
|
Guide](https://github.com/airbnb/javascript), using [ESLint](https://eslint.org)
|
|
and [prettier](https://github.com/prettier/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](https://github.com/typicode/husky) and
|
|
[lint-staged](https://github.com/okonet/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](https://github.com/typicode/husky)
|
|
package at least once (used for precommit 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.
|