diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0aeacff210..1245a5212c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -69,10 +69,11 @@ to help. if you run into any troubles. * Read the [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, - getting help in - [#git help](https://chat.zulip.org/#narrow/stream/44-git-help) if you run - into any troubles. + and do the Git tutorial (coming soon) if you are unfamiliar with + Git, getting help in + [#git help](https://chat.zulip.org/#narrow/stream/44-git-help) if + 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 [Dropbox Contributor License Agreement](https://opensource.dropbox.com/cla/). diff --git a/docs/git/zulip-tools.md b/docs/git/zulip-tools.md index 209fc66c12..0a1f09bfa3 100644 --- a/docs/git/zulip-tools.md +++ b/docs/git/zulip-tools.md @@ -5,12 +5,14 @@ time when working with Git on the Zulip project. ## Set up git repo script -In the `tools` directory of [zulip/zulip][github-zulip-zulip] you'll -find a bash script `setup-git-repo`. This script installs the Zulip -pre-commit hook. This hook will run each time you `git commit` to -automatically run Zulip's linters on just the files that the commit -modifies. The hook passes no matter the result of the linter, but you -should still pay attention to any notices or warnings it displays. +**Extremely useful**. In the `tools` directory of +[zulip/zulip][github-zulip-zulip] you'll find a bash script +`setup-git-repo`. This script installs a pre-commit hook, which will +run each time you `git commit` to automatically run +[Zulip's linter suite](../testing/linters.html) on just the files that +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: diff --git a/docs/testing/linters.md b/docs/testing/linters.md index 931ef3d5f3..9f41d82a85 100644 --- a/docs/testing/linters.md +++ b/docs/testing/linters.md @@ -31,18 +31,24 @@ and exempting legacy files from lint checks. ## Running the linters -If you run `./tools/test-all`, it will automatically run the linters (with -one small exception: it does not run mypy against scripts). - -You can also run them individually: +If you run `./tools/test-all`, it will automatically run the linters. +You can also run them individually or pass specific files: ./tools/lint + ./tools/lint static/js/compose.js + ./tools/lint static/js/ ./tools/run-mypy - ./tools/run-mypy --scripts-only Finally, you can rely on our Travis CI setup to run linters for you, but 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` new files before running lint checks.