Commit ea306a4
authored
Only lint changed files when pushing branch (#189)
The Git hook that's currently configured will lint all files in the
project when a branch is pushed. Linting takes a long time, so to speed
this up, only lint the files that have changed in the branch. Also, to
make the feedback loop even faster, fix those files instead of just
linting.
Also rename the package script to create the Git hooks from
`simple-git-hooks` to `setup-git-hooks` (so if we decide not to use
`simple-git-hooks` in the future we don't have to rename it again) and
update `bin/setup` script to run this script.
Finally, replace `simple-git-hooks` with `husky`. Our hook is now a
little bit more complicated as we need to figure out which branch the
current branch is based off of, find the files changed in the branch,
and run Prettier accordingly. Being able to just commit the hooks to the
repo as Husky allows us to do makes it possible to guarantee that we are
doing this.1 parent 37cedd6 commit ea306a4
File tree
5 files changed
+33
-22
lines changed- .husky
- bin
5 files changed
+33
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
| 8 | + | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | 7 | | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
13 | 11 | | |
14 | 12 | | |
15 | 13 | | |
16 | 14 | | |
17 | | - | |
18 | | - | |
| 15 | + | |
| 16 | + | |
19 | 17 | | |
20 | 18 | | |
21 | 19 | | |
22 | | - | |
23 | | - | |
24 | | - | |
| 20 | + | |
25 | 21 | | |
26 | 22 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
521 | 521 | | |
522 | 522 | | |
523 | 523 | | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
524 | 533 | | |
525 | 534 | | |
526 | 535 | | |
| |||
1025 | 1034 | | |
1026 | 1035 | | |
1027 | 1036 | | |
1028 | | - | |
1029 | | - | |
1030 | | - | |
1031 | | - | |
1032 | | - | |
1033 | | - | |
1034 | | - | |
1035 | | - | |
1036 | | - | |
1037 | 1037 | | |
1038 | 1038 | | |
1039 | 1039 | | |
| |||
1110 | 1110 | | |
1111 | 1111 | | |
1112 | 1112 | | |
| 1113 | + | |
1113 | 1114 | | |
1114 | | - | |
1115 | 1115 | | |
1116 | 1116 | | |
1117 | 1117 | | |
| |||
0 commit comments