From dce67565c696c3e4e270c91c7ccbb9203700b548 Mon Sep 17 00:00:00 2001 From: Jordan Webb Date: Thu, 3 Jun 2021 22:17:32 -0500 Subject: [PATCH] Linty bits (#4) * 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> --- .github/workflows/depup.yml | 3 ++- README.md | 9 ++++----- script.sh | 19 ++++++++++--------- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.github/workflows/depup.yml b/.github/workflows/depup.yml index 2f2e65e..b1597cc 100644 --- a/.github/workflows/depup.yml +++ b/.github/workflows/depup.yml @@ -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: diff --git a/README.md b/README.md index 3ed9963..96b2199 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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`. diff --git a/script.sh b/script.sh index af5021d..966aa28 100755 --- a/script.sh +++ b/script.sh @@ -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::'