https://github.com/jordemort/action-pyright
A GitHub Action to run pyright
https://github.com/jordemort/action-pyright
github-actions pyright python reviewdog reviewdog-action
Last synced: 19 days ago
JSON representation
A GitHub Action to run pyright
- Host: GitHub
- URL: https://github.com/jordemort/action-pyright
- Owner: jordemort
- License: mit
- Created: 2021-06-04T01:47:49.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-12-05T14:19:00.000Z (5 months ago)
- Last Synced: 2025-04-04T18:54:35.717Z (24 days ago)
- Topics: github-actions, pyright, python, reviewdog, reviewdog-action
- Language: Python
- Homepage:
- Size: 460 KB
- Stars: 12
- Watchers: 2
- Forks: 5
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# action-pyright
[](https://github.com/jordemort/action-pyright/actions/workflows/test.yml)
[](https://github.com/jordemort/action-pyright/actions?query=workflow%3Adepup)
[](https://github.com/jordemort/action-pyright/actions?query=workflow%3Arelease)
[](https://github.com/jordemort/action-pyright/releases)
[](https://github.com/haya14busa/action-bumpr)This is an action that runs the [pyright](https://github.com/Microsoft/pyright) type checker against your Python code, and uses [reviewdog](https://github.com/reviewdog/reviewdog) to create GitHub PR comments or reviews with the results.

This action is based on [action-eslint](https://github.com/reviewdog/action-eslint) and inspired by [pyright-action](https://github.com/jakebailey/pyright-action).
You can configure pyright using [`pyrightconfig.json` or `pyproject.toml`](https://github.com/microsoft/pyright/blob/main/docs/configuration.md), or see the inputs below.
## Example usage
```yml
name: reviewdog
on: [pull_request]
jobs:
pyright:
name: pyright
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: jordemort/action-pyright@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }} # You need this
reporter: github-pr-review # Change reporter.
lib: true
```## Inputs
### `github_token`
**Required**. Default is `${{ github.token }}`.
### `level`
Optional. Report level for reviewdog [info,warning,error].
It's same as `-level` flag of reviewdog.### `reporter`
Reporter of reviewdog command [github-pr-check,github-check,github-pr-review].
Default is github-pr-review.
It's same as `-reporter` flag of reviewdog.### `filter_mode`
Optional. Filtering mode for the reviewdog command [added,diff_context,file,nofilter].
Default is added.### `fail_on_error`
Optional. Exit code for reviewdog when errors are found [true,false]
Default is `false`.### `reviewdog_flags`
Optional. Additional reviewdog flags
### `workdir`
Optional. The directory from which to run pyright. Default '.'
### `pyright_version`
Optional. Version of pyright to run. If not specified, the latest version will be used.
### `python_platform`
Optional. Analyze for a specific platform (Darwin, Linux, Windows)
### `python_version`
Optional. Analyze for a specific Python version (3.3, 3.4, etc.)
### `typeshed_path`
Optional. Use typeshed type stubs at this location.
### `venv_path`
Optional. Directory that contains virtual environments.
### `project`
Optional. Use the configuration file at this location.
### `lib`
Optional. Use library code to infer types when stubs are missing. Default `false`.
### `pyright_flags`
Optional extra arguments; can be used to specify specific files to check.