Skip to content

Commit b708e3b

Browse files
chore: Add mypy github action (#1460)
1 parent 33c149e commit b708e3b

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

.github/sync-repo-settings.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ branchProtectionRules:
1212
- 'cla/google'
1313
- 'docs'
1414
- 'lint'
15+
- 'mypy'
1516
- 'unit (3.9)'
1617
- 'unit (3.10)'
1718
- 'unit (3.11)'

.github/workflows/mypy.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
on:
2+
pull_request:
3+
branches:
4+
- main
5+
name: mypy
6+
jobs:
7+
mypy:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v4
12+
- name: Setup Python
13+
uses: actions/setup-python@v5
14+
with:
15+
python-version: "3.10"
16+
- name: Install nox
17+
run: |
18+
python -m pip install --upgrade setuptools pip wheel
19+
python -m pip install nox
20+
- name: Run mypy
21+
run: |
22+
nox -s mypy

noxfile.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,12 @@ def lint(session):
145145
Returns a failure if the linters find linting errors or sufficiently
146146
serious code quality issues.
147147
"""
148-
session.install("flake8", BLACK_VERSION)
148+
session.install("flake8", BLACK_VERSION, ISORT_VERSION)
149+
session.run(
150+
"isort",
151+
"--check",
152+
*LINT_PATHS,
153+
)
149154
session.run(
150155
"black",
151156
"--check",

0 commit comments

Comments
 (0)