Skip to content

Commit 597cc38

Browse files
committed
github: add workflows to check formatting and typecheck
1 parent 52e06fd commit 597cc38

File tree

3 files changed

+57
-0
lines changed

3 files changed

+57
-0
lines changed

.github/workflows/check-format.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: ruff
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
jobs:
9+
format:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Install uv
16+
uses: astral-sh/setup-uv@v3
17+
18+
- name: "Set up Python"
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version-file: ".python-version"
22+
23+
- name: Install the project
24+
run: uv sync --all-extras --dev
25+
26+
- name: Run ruff format check
27+
run: uv run ruff check .

.github/workflows/check-types.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: typecheck
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
jobs:
9+
typecheck:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Install uv
16+
uses: astral-sh/setup-uv@v3
17+
18+
- name: "Set up Python"
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version-file: ".python-version"
22+
23+
- name: Install the project
24+
run: uv sync --all-extras --dev
25+
26+
- name: Run pyright
27+
run: uv run pyright

pyproject.toml

+3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ include = ["mcp_python", "tests"]
2525
venvPath = "."
2626
venv = ".venv"
2727

28+
[tool.uv]
29+
dev-dependencies = ["ruff", "pyright"]
30+
2831
[tool.ruff.lint]
2932
select = ["E", "F", "I"]
3033
ignore = []

0 commit comments

Comments
 (0)