-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add python static type checking in CI checks (#11518)
- Enable pyright and pylint (https://github.com/microsoft/pyright) in CI - Enable pyright, pylint and bandit by default in VS code Pylint has some good style checks. pyright is Microsoft's static type checker.
- Loading branch information
1 parent
c556f5f
commit d9c9adb
Showing
3 changed files
with
27 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,8 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: reviewdog/action-black@v3 | ||
- name: black | ||
uses: reviewdog/action-black@v3 | ||
with: | ||
github_token: ${{ secrets.github_token }} | ||
# Change reviewdog reporter if you need [github-pr-check, github-check, github-pr-review]. | ||
|
@@ -22,7 +23,8 @@ jobs: | |
# GitHub Status Check won't become failure with a warning. | ||
level: error | ||
filter_mode: file | ||
- uses: reviewdog/action-flake8@v3 | ||
- name: flake8 | ||
uses: reviewdog/action-flake8@v3 | ||
with: | ||
github_token: ${{ secrets.github_token }} | ||
reporter: github-pr-check | ||
|
@@ -50,14 +52,22 @@ jobs: | |
reporter: github-pr-check | ||
level: info | ||
filter_mode: file | ||
- name: markdownlint | ||
uses: reviewdog/action-[email protected] | ||
- name: pyright | ||
uses: jordemort/action-pyright@v1 | ||
with: | ||
github_token: ${{ secrets.github_token }} | ||
reporter: github-pr-check | ||
level: info | ||
filter_mode: file | ||
markdownlint_flags: ". --disable MD013 MD041 MD033 MD034" | ||
level: warning | ||
filter_mode: diff_context | ||
lib: true | ||
- name: pylint | ||
uses: dciborow/[email protected] | ||
with: | ||
github_token: ${{ secrets.github_token }} | ||
reporter: github-pr-check | ||
level: warning | ||
filter_mode: diff_context | ||
glob_pattern: "**/*.py" | ||
|
||
lint-python-format: | ||
# Separated black/isort from other Python linters because we want this job to | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters