This repository was archived by the owner on Jul 30, 2021. It is now read-only.
Commit 80111c9
committed
Makefile: Use 'git diff --exit-code' for the gofmt check
This makes fixing errors easier, because you can just commit/amend
after a failed 'make gofmt'. The diff check failes the target if
there are any changes (either from gofmt or otherwise), which is good
for continuous integration testing and such.
Splitting gofmt out into its own .PHONY rule makes it more obvious
that the diff call is part of the check, and allows you to run the
gofmt check without pulling in the other, unrelated 'check' tests.
This also reduces our shell exposure. The read and [ bits looked ok
to me, but this was the only place we called read in the Makefile, so
I expect it was the source of [1]:
05:22:18 [1650506.967906] golang[6]: /bin/sh: 1: read: arg count
which was part of the motivation for 132a381 (use bash for the
makefile shell, 2018-01-29, #870).
[1]: #870 (comment)1 parent 0749dc0 commit 80111c9
1 file changed
+6
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | | - | |
| 30 | + | |
32 | 31 | | |
33 | 32 | | |
34 | 33 | | |
| |||
38 | 37 | | |
39 | 38 | | |
40 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
41 | 44 | | |
42 | 45 | | |
43 | 46 | | |
| |||
80 | 83 | | |
81 | 84 | | |
82 | 85 | | |
83 | | - | |
| 86 | + | |
0 commit comments