diff --git a/.github/workflows/run-linter.yml b/.github/workflows/run-linter.yml index a418a425..22a577ea 100644 --- a/.github/workflows/run-linter.yml +++ b/.github/workflows/run-linter.yml @@ -22,16 +22,42 @@ jobs: - name: Install dependencies run: | pip install -U pip tox wheel setuptools setuptools_scm[toml] - pip install .[check] - name: Lint checks run: | - flake8 py7zr tests | ./bin/reviewdog -f flake8 -reporter=github-pr-check -level=error - mypy py7zr | ./bin/reviewdog -f mypy -reporter=github-pr-check -level=error - pylint **/*.py | ./bin/reviewdog -efm="%f:%l:%c: %m" -name="pylint" -reporter=github-pr-check -fail-level=error -level=warning + tox -e linter | ./bin/reviewdog -efm="%f:%l:%c: %m" -name="pylint" -reporter=github-pr-check -fail-level=error -level=warning env: - REVIEWDOG_TOKEN: ${{ secrets.REVIEWDOG_TOKEN }} REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} + mypy: + name: mypy + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: tsuyoshicho/action-mypy@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + target: py7zr + reporter: github-pr-check + level: error + + flake8-lint: + runs-on: ubuntu-22.04 + name: Lint + steps: + - name: Check out source repository + uses: actions/checkout@v4 + - name: Set up Python environment + uses: actions/setup-python@v5 + with: + python-version: "3.12" + - run: pip install .[check] + - name: flake8 Lint + uses: reviewdog/action-flake8@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + reporter: github-pr-check + level: error + docs: name: Document checks runs-on: ubuntu-22.04 diff --git a/pyproject.toml b/pyproject.toml index 45c18690..40c72ad6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -170,7 +170,7 @@ markers = [ legacy_tox_ini = """ [tox] isolated_build = True -envlist = mypy, check, pypy{39,310}, py{39,310,311,312,313}, py39d, docs, mprof, distcheck +envlist = mypy, check, pypy{39,310}, py{39,310,311,312,313}, py39d, docs, mprof, distcheck, linter [testenv] passenv = @@ -222,6 +222,11 @@ commands = python -m build --sdist twine check dist/* +[testenv:linter] +extras = check +commands = + python -m pylint **/*/py + [testenv:clean] deps = coverage[toml]>=5.2 skip_install = true