Skip to content

Commit

Permalink
chore: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
miurahr committed Dec 15, 2024
1 parent b878a30 commit 32e3140
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 6 deletions.
36 changes: 31 additions & 5 deletions .github/workflows/run-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Check warning on line 36 in .github/workflows/run-linter.yml

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.github/workflows/run-linter.yml#L36

An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release.
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

Check warning on line 55 in .github/workflows/run-linter.yml

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.github/workflows/run-linter.yml#L55

An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release.
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-check
level: error

docs:
name: Document checks
runs-on: ubuntu-22.04
Expand Down
7 changes: 6 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 32e3140

Please sign in to comment.