Skip to content

Commit

Permalink
Merge pull request #17 from narugit/feature/add_reviewdog
Browse files Browse the repository at this point in the history
Add reviewdog for cpplint and mispell
  • Loading branch information
narugit authored Aug 28, 2023
2 parents c564157 + 599fb33 commit da1fe79
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Reviewdog
on: [pull_request]
jobs:
cpplint:
name: runner / cpplint
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup reviewdog
uses: reviewdog/action-setup@v1
with:
reviewdog_version: latest
- name: Install cpplint
run: pip install cpplint
- name: run cpplint
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.github_token }}
run: |
cpplint --linelength=120 --recursive . 2>&1 | \
reviewdog -efm="%f:%l: %m" -name="cpplint" -reporter="github-pr-review" \
-level="error" -fail-on-error=true -diff="git diff FETCH_HEAD"
misspell:
name: runner / misspell
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup reviewdog
uses: reviewdog/action-setup@v1
with:
reviewdog_version: latest
- name: Install misspell
run: |
curl -L https://git.io/misspell -o ${{ runner.temp }}/install-misspell.sh
sudo sh ${{ runner.temp }}/install-misspell.sh -b /usr/local/bin/
- name: Run misspell
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.github_token }}
run: |
git diff origin/${GITHUB_BASE_REF}...origin/${GITHUB_HEAD_REF} --name-only \
| xargs misspell -locale=US 2>&1 \
| reviewdog \
-efm="%f:%l:%c: %m" \
-fail-on-error=true \
-level="error" \
-name="misspell" \
-reporter="github-pr-review"

0 comments on commit da1fe79

Please sign in to comment.