|
17 | 17 | <div class="page-header"> |
18 | 18 | <h1>Introduction</h1> |
19 | 19 | </div> |
| 20 | +===============================================================================V |
20 | 21 | <p> |
21 | | - At Yelp we rely heavily on pre-commit hooks to find and fix common issues before |
22 | | - changes are submitted for code review. We run our hooks before every commit to |
23 | | - automatically point out issues like missing semicolons, whitespace problems, and |
24 | | - testing statements in code. Automatically fixing these issues before posting |
25 | | - code reviews allows our code reviewer to pay attention to the architecture of a |
26 | | - change and not worry about trivial errors. |
| 22 | + Git hook scripts are useful for identifying simple issues |
| 23 | + before submission to code review. We run our hooks on every |
| 24 | + commit to automatically point out issues in code such as |
| 25 | + missing semicolons, trailing whitespace, and debug statements. |
| 26 | + By pointing these issues out before code review, this allows a |
| 27 | + code reviewer to focus on the architecture of a change while |
| 28 | + not wasting time with trivial style nitpicks. |
27 | 29 | </p> |
28 | 30 | <p> |
29 | | - As we created more libraries and projects we recognized that sharing our pre |
30 | | - commit hooks across projects is painful. We copied and pasted bash scripts |
31 | | - from project to project and had to manually change the hooks to work for |
| 31 | + As we created more libraries and projects we recognized that |
| 32 | + sharing our pre-commit hooks across projects is painful. We |
| 33 | + copied and pasted unwieldy bash scripts from project to |
| 34 | + project and had to manually change the hooks to work for |
32 | 35 | different project structures. |
33 | 36 | </p> |
34 | 37 | <p> |
35 | | - We believe that you should always use the best industry standard linters. Some |
36 | | - of the best linters are written in languages that you do not use in your project |
37 | | - or have installed on your machine. For example scss-lint is a linter for SCSS |
38 | | - written in Ruby. If you’re writing a project in node you should be able to use |
39 | | - scss-lint as a pre-commit hook without adding a Gemfile to your project or |
40 | | - understanding how to get scss-lint installed. |
41 | | - </p> |
42 | | - <p> |
43 | | - We built pre-commit to solve our hook issues. It is a multi-language package |
44 | | - manager for pre-commit hooks. You specify a list of hooks you want and |
45 | | - pre-commit manages the installation and execution of any hook written in any |
46 | | - language before every commit. pre-commit is specifically designed to not require |
47 | | - root access. If one of your developers doesn’t have node installed but modifies |
48 | | - a JavaScript file, pre-commit automatically handles downloading and building node |
49 | | - to run jshint without root. |
| 38 | + We believe that you should always use the best industry |
| 39 | + standard linters. Some of the best linters are written in |
| 40 | + languages that you do not use in your project or have |
| 41 | + installed on your machine. For example scss-lint is a linter |
| 42 | + for SCSS written in Ruby. If you’re writing a project in node |
| 43 | + you should be able to use scss-lint as a pre-commit hook |
| 44 | + without adding a Gemfile to your project or understanding how |
| 45 | + to get scss-lint installed. |
| 46 | + </p> |
| 47 | + <p> |
| 48 | + We built pre-commit to solve our hook issues. It is a |
| 49 | + multi-language package manager for pre-commit hooks. You |
| 50 | + specify a list of hooks you want and pre-commit manages the |
| 51 | + installation and execution of any hook written in any language |
| 52 | + before every commit. pre-commit is specifically designed to not |
| 53 | + require root access. If one of your developers doesn’t have |
| 54 | + node installed but modifies a JavaScript file, pre-commit |
| 55 | + automatically handles downloading and building node to run |
| 56 | + eslint without root. |
50 | 57 | </p> |
51 | 58 | </div> |
52 | 59 |
|
|
0 commit comments