aboutsummaryrefslogtreecommitdiff
path: root/doc/precommit.md
diff options
context:
space:
mode:
authorJulie Qiu <julie@golang.org>2020-06-11 13:16:04 -0400
committerJulie Qiu <julieqiu@google.com>2020-06-11 17:53:07 +0000
commit2cc778a6a3dce356b3e9658948bec5d6308d733c (patch)
treedb9bd49d47f54d219f865528f8e090b73b769c4c /doc/precommit.md
parente82bfc45164d6b5c8717b0bc92028e1c1e3e278c (diff)
downloadgo-x-pkgsite-2cc778a6a3dce356b3e9658948bec5d6308d733c.tar.xz
doc: format and ran prettier on precommit.md
Change-Id: Ibcff373bc817f2b67abbb45b85ae7ccb34b5bcfd Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/768318 CI-Result: Cloud Build <devtools-proctor-result-processor@system.gserviceaccount.com> Reviewed-by: Jonathan Amsterdam <jba@google.com>
Diffstat (limited to 'doc/precommit.md')
-rw-r--r--doc/precommit.md24
1 files changed, 13 insertions, 11 deletions
diff --git a/doc/precommit.md b/doc/precommit.md
index b7286ff3..c955a72c 100644
--- a/doc/precommit.md
+++ b/doc/precommit.md
@@ -1,22 +1,24 @@
### Install pre-commit hook
The `all.bash` script runs quickly enough so that you can use it as a git
-pre-commit hook. If you don't already have a pre-commit hook, you can install it with
+pre-commit hook. If you don't already have a pre-commit hook, you can install
+it with
```
ln -s -f ../../all.bash .git/hooks/pre-commit
```
-Google workstations start with a small shell script as a pre-commit hook. To add
-`all.bash` to it, edit `.git/hooks/pre-commit` and add the line
+Google workstations start with a small shell script as a pre-commit hook. To
+add `all.bash` to it, edit `.git/hooks/pre-commit` and add the line
```
./all.bash
```
You may prefer to run `all.bash` only when you push (which happens when you run
-`git codereview mail`). You'll need a small script to discard the arguments that
-the pre-push hook is called with. Make this the contents of `.git/hooks/pre-push`:
+`git codereview mail`). You'll need a small script to discard the arguments
+that the pre-push hook is called with. Make this the contents of
+`.git/hooks/pre-push`:
```
#!/bin/sh
@@ -31,14 +33,14 @@ chmod +x .git/hooks/pre-push
### Running Linters/Formatters/Tests
-The `all.bash` script can be used to selectively run actions on the source (e.g.
-linters, code formatters, or tests). Run `./all.bash help` to see a list of
-supported actions.
+The `all.bash` script can be used to selectively run actions on the source
+(e.g. linters, code formatters, or tests). Run `./all.bash help` to see a list
+of supported actions.
Some actions are not run by the default invocation of `./all.bash` that is
-executed in the commit hook. Notably, the `prettier` command is not run, because
-it has a dependency on nodejs, which is otherwise not needed and which not all
-developers have installed on their system.
+executed in the commit hook. Notably, the `prettier` command is not run,
+because it has a dependency on nodejs, which is otherwise not needed and which
+not all developers have installed on their system.
If you are modifying CSS or Javascript, install prettier as described at
https://prettier.io/docs/en/install.html, and run `./all.bash prettier` to