From d687708503d61a35eb6d378e0cf70fc724bfaf63 Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Wed, 22 Jul 2020 16:53:34 -0700 Subject: [PATCH] Updated "getting started" documentation to include an example git hook definition. --- docs/getting-started.md | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/docs/getting-started.md b/docs/getting-started.md index 16dadf3d9..bd9eade96 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -16,9 +16,24 @@ Here is a typical progression: 11. Optionally add entire subdirectories to the `strict` config entry to indicate that all files within those subdirectories should be strictly typed. -### Running Pyright as part of Continuous Integration (CI) +### Running Pyright as a git hook -Here is a simple bash script that installs the latest version of Pyright and runs it on a code base. It can be used in a CI environment. +You can configure pyright to run as a git hook (e.g. prior to each check-in) by using the following hook definition: +``` +- repo: local + hooks: + - id: pyright + name: pyright + entry: pyright + language: node + pass_filenames: false + types: [python] + additional_dependencies: ['pyright@1.1.55'] +``` + +### Running Pyright from a Continuous Integration (CI) script + +Alternatively, you can run pyright from a bash script. Here's a script that installs the latest version of pyright and runs it. ``` #!/bin/bash