Skip to content

Commit

Permalink
Linty bits (#4)
Browse files Browse the repository at this point in the history
* Add some bits missed by the linter

* Tweak readme

* Allow manual depup

* Update .github/workflows/depup.yml

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update .github/workflows/depup.yml

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* shfmt

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
Jordan Webb and github-actions[bot] authored Jun 4, 2021
1 parent bfb4716 commit dce6756
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/depup.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: depup
on:
schedule:
- cron: '14 14 * * *' # Runs at 14:14 UTC every day
- cron: "14 14 * * *" # Runs at 14:14 UTC every day
repository_dispatch:
types: [depup]
workflow_dispatch:

jobs:
reviewdog:
Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
# GitHub Action: Run pyright with reviewdog
# action-pyright

[![depup](https://github.com/jordemort/action-pyright/workflows/depup/badge.svg)](https://github.com/jordemort/action-pyright/actions?query=workflow%3Adepup)
[![release](https://github.com/jordemort/action-pyright/workflows/release/badge.svg)](https://github.com/jordemort/action-pyright/actions?query=workflow%3Arelease)
[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/jordemort/action-pyright?logo=github&sort=semver)](https://github.com/jordemort/action-pyright/releases)
[![action-bumpr supported](https://img.shields.io/badge/bumpr-supported-ff69b4?logo=github&link=https://github.com/haya14busa/action-bumpr)](https://github.com/haya14busa/action-bumpr)

This action runs [pyright](https://github.com/Microsoft/pyright) with
[reviewdog](https://github.com/reviewdog/reviewdog) on pull requests to improve
code review experience.
This is an action that runs [pyright](https://github.com/Microsoft/pyright) 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 [pyright-action](https://github.com/jakebailey/pyright-action).
This action is based on [action-eslint](https://github.com/reviewdog/action-eslint) and inspired by [pyright-action](https://github.com/jakebailey/pyright-action).

## Example usage

Expand Down Expand Up @@ -88,6 +86,7 @@ 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`.
Expand Down
19 changes: 10 additions & 9 deletions script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,16 @@ if [ -n "${INPUT_LIB:-}" ] ; then
fi

echo '::group::🔎 Running pyright with reviewdog 🐶 ...'
$(npm bin)/pyright "${PYRIGHT_ARGS[@]}" ${INPUT_PYRIGHT_FLAGS:-} \
| python3 "${BASE_PATH}/pyright_to_rdjson.py" \
| reviewdog -f=rdjson \
-name="${INPUT_TOOL_NAME}" \
-reporter="${INPUT_REPORTER:-github-pr-review}" \
-filter-mode="${INPUT_FILTER_MODE}" \
-fail-on-error="${INPUT_FAIL_ON_ERROR}" \
-level="${INPUT_LEVEL}" \
${INPUT_REVIEWDOG_FLAGS}
# shellcheck disable=SC2086
"$(npm bin)/pyright" "${PYRIGHT_ARGS[@]}" ${INPUT_PYRIGHT_FLAGS:-} |
python3 "${BASE_PATH}/pyright_to_rdjson.py" |
reviewdog -f=rdjson \
-name="${INPUT_TOOL_NAME}" \
-reporter="${INPUT_REPORTER:-github-pr-review}" \
-filter-mode="${INPUT_FILTER_MODE}" \
-fail-on-error="${INPUT_FAIL_ON_ERROR}" \
-level="${INPUT_LEVEL}" \
${INPUT_REVIEWDOG_FLAGS}

reviewdog_rc=$?
echo '::endgroup::'
Expand Down

0 comments on commit dce6756

Please sign in to comment.