Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add basic mypy workflow to CI
  • Loading branch information
AlexWaygood committed May 12, 2023
commit 00183ff17574307e4ceac7cf0b31c1866c1e70f8
31 changes: 31 additions & 0 deletions .github/workflows/mypy-clinic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Run mypy on Tools/clinic

on:
push:
branches:
- main
pull_request:
paths:
- "Tools/clinic/**/*"
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
mypy:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: pip
cache-dependency-path: .github/workflows/mypy-clinic.yml
- run: pip install mypy==1.3.0
- run: mypy --config-file Tools/clinic/mypy.ini
9 changes: 9 additions & 0 deletions Tools/clinic/mypy.ini
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I usually put my mypy config in a pyproject.toml file these days, but a mypy.ini file feels like it makes more "sense" unless we're planning on adding other linters/formatters to check clinic.py in the future

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[mypy]
pretty = True
enable_error_code = ignore-without-code
disallow_any_generics = True
strict_concatenate = True
warn_redundant_casts = True
warn_unused_ignores = True
warn_unused_configs = True
files = Tools/clinic/