Skip to content

Commit

Permalink
chore: update lint checks with reviewdog
Browse files Browse the repository at this point in the history
Signed-off-by: Hiroshi Miura <[email protected]>
  • Loading branch information
miurahr committed Dec 17, 2024
1 parent eb11c9f commit 1418702
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 12 deletions.
11 changes: 0 additions & 11 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,10 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Setup reviewdog
uses: reviewdog/action-setup@v1
with:
reviewdog_version: latest
- name: Install tools
run: |
pip install -U pip
pip install tox tox-gh-actions coveralls coverage[toml]
- name: Lint checks
run: |
tox -e check | reviewdog -f flake8 -reporter=github-pr-review -fail-level=error
tox -e mypy | reviewdog -f mypy -reporter=github-pr-review -fail-level=error
tox -e docs
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Test
run: tox
env:
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/run-linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Run linter

on:
pull_request:

jobs:
linter:
name: Linter
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.12'
architecture: x64
- name: Setup reviewdog
run: |
/usr/bin/sh ci/reviewdog_install.sh -b ./bin/ v0.20.3
- name: Install dependencies
run: |
pip install -U pip tox wheel setuptools coveralls coverage[toml]
- name: run reviewdog
run: |
./bin/reviewdog -runners=flake8,mypy,pylint -reporter=github-pr-check -conf=.reviewdog.yml
env:
REVIEWDOG_TOKEN: ${{ secrets.REVIEWDOG_TOKEN }}
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}

docs:
name: Document checks
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.12'
architecture: x64
- name: Install dependencies
run: |
pip install -U pip tox wheel setuptools setuptools_scm[toml]
- name: docs build and link check
run: |
tox -e docs
19 changes: 19 additions & 0 deletions .reviewdog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
runner:
flake8:
name: flake8
cmd: flake8 aqt tests
format: flake8
level: error

mypy:
name: mypy
cmd: mypy --strict --show-column-numbers -p aqt
errorformat:
- "%f:%l:%c: %m"
level: error

pylint:
name: pylint
cmd: pylint **/*.py -j 0
errorformat:
- "%f:%l:%c: %t%n: %m"
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -242,5 +242,5 @@ python =
3.10: py310
3.11: py311
3.12: py312
3.13-dev: py313
3.13: py313
"""

0 comments on commit 1418702

Please sign in to comment.