Skip to content

Commit

Permalink
add mypy action
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-mue committed Jan 9, 2025
1 parent 6b707e9 commit 3bd83e1
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Run mypy

on:
pull_request:
push:
branches:
- main

jobs:
mypy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Set up Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version-file: pyproject.toml

- name: Install hatch
run: pip install hatch --upgrade

- name: Set up reviewdog
if: github.event_name == 'pull_request'
uses: reviewdog/action-setup@3f401fe1d58fe77e10d665ab713057375e39b887 # v1.3.0

- name: Run mypy
if: github.event_name != 'pull_request'
run: hatch run mypy geometer

- name: Run mypy with reviewdog
if: github.event_name == 'pull_request'
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: hatch run mypy geometer | reviewdog -f=mypy -name=mypy -tee -reporter=github-pr-check -filter-mode nofilter
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ repos:
hooks:
- id: python-check-blanket-noqa
- id: python-check-blanket-type-ignore
- id: text-unicode-replacement-char

0 comments on commit 3bd83e1

Please sign in to comment.