mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-14 20:48:00 +00:00
Github action: Inline lint python / js / cpp (#11328)
Uses the reviewdog action which supports inline reporting.
This commit is contained in:
parent
0292356bd7
commit
4ec5fe5c8a
1 changed files with 100 additions and 0 deletions
100
.github/workflows/lint.yml
vendored
Normal file
100
.github/workflows/lint.yml
vendored
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
name: Lint
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
lint-python:
|
||||
name: Lint Python
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- 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].
|
||||
reporter: github-pr-check
|
||||
# Change reporter level if you need.
|
||||
# GitHub Status Check won't become failure with a warning.
|
||||
level: error
|
||||
filter_mode: file
|
||||
- uses: reviewdog/action-flake8@v3
|
||||
with:
|
||||
github_token: ${{ secrets.github_token }}
|
||||
reporter: github-pr-check
|
||||
level: error
|
||||
filter_mode: file
|
||||
- name: pyflakes
|
||||
uses: reviewdog/action-pyflakes@v1
|
||||
with:
|
||||
github_token: ${{ secrets.github_token }}
|
||||
reporter: github-pr-check
|
||||
level: warning
|
||||
filter_mode: file
|
||||
- name: misspell # Check spellings as well
|
||||
uses: reviewdog/action-misspell@v1
|
||||
with:
|
||||
github_token: ${{ secrets.github_token }}
|
||||
locale: "US"
|
||||
reporter: github-pr-check
|
||||
level: info
|
||||
filter_mode: diff_context
|
||||
- name: shellcheck # Static check shell scripts
|
||||
uses: reviewdog/action-shellcheck@v1
|
||||
with:
|
||||
github_token: ${{ secrets.github_token }}
|
||||
reporter: github-pr-check
|
||||
level: info
|
||||
filter_mode: file
|
||||
- name: markdownlint
|
||||
uses: reviewdog/action-markdownlint@v0.7
|
||||
with:
|
||||
github_token: ${{ secrets.github_token }}
|
||||
reporter: github-pr-check
|
||||
level: info
|
||||
filter_mode: file
|
||||
markdownlint_flags: ". --disable MD013 MD041 MD033 MD034"
|
||||
|
||||
lint-python-format:
|
||||
# Separated black/isort from other Python linters because we want this job to
|
||||
# fail and not affect other linters
|
||||
name: Python format
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: "3.10"
|
||||
- uses: psf/black@stable
|
||||
with:
|
||||
options: "--check --diff --color"
|
||||
- uses: isort/isort-action@master
|
||||
|
||||
lint-cpp:
|
||||
name: Lint C++
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- uses: reviewdog/action-cpplint@master
|
||||
with:
|
||||
github_token: ${{ secrets.github_token }}
|
||||
reporter: github-pr-check
|
||||
level: warning
|
||||
flags: --linelength=120
|
||||
|
||||
lint-js:
|
||||
name: Lint JavaScript
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: reviewdog/action-eslint@v1
|
||||
with:
|
||||
reporter: github-pr-check
|
||||
level: error
|
||||
filter_mode: file
|
||||
eslint_flags: "--ext .ts --ext .tsx"
|
||||
workdir: "js/"
|
||||
Loading…
Reference in a new issue