mirror of https://github.com/zulip/zulip.git
docs: Increase highlighting of our linters in documentation.
This commit is contained in:
parent
4f022d3428
commit
30e5b5fe55
|
@ -69,10 +69,11 @@ to help.
|
||||||
if you run into any troubles.
|
if you run into any troubles.
|
||||||
* Read the
|
* Read the
|
||||||
[Zulip guide to Git](https://zulip.readthedocs.io/en/latest/git/index.html)
|
[Zulip guide to Git](https://zulip.readthedocs.io/en/latest/git/index.html)
|
||||||
and do the Git tutorial (coming soon) if you are unfamiliar with Git,
|
and do the Git tutorial (coming soon) if you are unfamiliar with
|
||||||
getting help in
|
Git, getting help in
|
||||||
[#git help](https://chat.zulip.org/#narrow/stream/44-git-help) if you run
|
[#git help](https://chat.zulip.org/#narrow/stream/44-git-help) if
|
||||||
into any troubles.
|
you run into any troubles. Be sure to check out the
|
||||||
|
[extremely useful Zulip-specific tools page](https://zulip.readthedocs.io/en/latest/git/zulip-tools.html).
|
||||||
* Sign the
|
* Sign the
|
||||||
[Dropbox Contributor License Agreement](https://opensource.dropbox.com/cla/).
|
[Dropbox Contributor License Agreement](https://opensource.dropbox.com/cla/).
|
||||||
|
|
||||||
|
|
|
@ -5,12 +5,14 @@ time when working with Git on the Zulip project.
|
||||||
|
|
||||||
## Set up git repo script
|
## Set up git repo script
|
||||||
|
|
||||||
In the `tools` directory of [zulip/zulip][github-zulip-zulip] you'll
|
**Extremely useful**. In the `tools` directory of
|
||||||
find a bash script `setup-git-repo`. This script installs the Zulip
|
[zulip/zulip][github-zulip-zulip] you'll find a bash script
|
||||||
pre-commit hook. This hook will run each time you `git commit` to
|
`setup-git-repo`. This script installs a pre-commit hook, which will
|
||||||
automatically run Zulip's linters on just the files that the commit
|
run each time you `git commit` to automatically run
|
||||||
modifies. The hook passes no matter the result of the linter, but you
|
[Zulip's linter suite](../testing/linters.html) on just the files that
|
||||||
should still pay attention to any notices or warnings it displays.
|
the commit modifies (which is really fast!). The hook passes no matter
|
||||||
|
the result of the linter, but you should still pay attention to any
|
||||||
|
notices or warnings it displays.
|
||||||
|
|
||||||
It's simple to use. Make sure you're in the clone of zulip and run the following:
|
It's simple to use. Make sure you're in the clone of zulip and run the following:
|
||||||
|
|
||||||
|
|
|
@ -31,18 +31,24 @@ and exempting legacy files from lint checks.
|
||||||
|
|
||||||
## Running the linters
|
## Running the linters
|
||||||
|
|
||||||
If you run `./tools/test-all`, it will automatically run the linters (with
|
If you run `./tools/test-all`, it will automatically run the linters.
|
||||||
one small exception: it does not run mypy against scripts).
|
You can also run them individually or pass specific files:
|
||||||
|
|
||||||
You can also run them individually:
|
|
||||||
|
|
||||||
./tools/lint
|
./tools/lint
|
||||||
|
./tools/lint static/js/compose.js
|
||||||
|
./tools/lint static/js/
|
||||||
./tools/run-mypy
|
./tools/run-mypy
|
||||||
./tools/run-mypy --scripts-only
|
|
||||||
|
|
||||||
Finally, you can rely on our Travis CI setup to run linters for you, but
|
Finally, you can rely on our Travis CI setup to run linters for you, but
|
||||||
it is good practice to run lint checks locally.
|
it is good practice to run lint checks locally.
|
||||||
|
|
||||||
|
**Important:** We provide a
|
||||||
|
[Git pre-commit hook](http://localhost:9991/docs/git/zulip-tools.html#set-up-git-repo-script)
|
||||||
|
that can automatically run `tools/lint` on just the files that
|
||||||
|
changed (in a few 100ms) whenever you make a commit. This can save
|
||||||
|
you a lot of time, by automatically detecting linter errors as you
|
||||||
|
make them.
|
||||||
|
|
||||||
**Note:** The linters only check files that git tracks. Remember to `git add`
|
**Note:** The linters only check files that git tracks. Remember to `git add`
|
||||||
new files before running lint checks.
|
new files before running lint checks.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue