Skip to content

Commit 042006e

Browse files
committed
github: add workflows to check formatting and typecheck
1 parent eb410fe commit 042006e

File tree

4 files changed

+462
-0
lines changed

4 files changed

+462
-0
lines changed

.github/workflows/check-format.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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+
with:
18+
enable-cache: true
19+
20+
- name: "Set up Python"
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version-file: ".python-version"
24+
25+
- name: Install the project
26+
run: uv sync --frozen --all-extras --dev
27+
28+
- name: Run ruff format check
29+
run: uv runa --frozen ruff check .

.github/workflows/check-types.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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+
with:
18+
enable-cache: true
19+
20+
- name: "Set up Python"
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version-file: ".python-version"
24+
25+
- name: Install the project
26+
run: uv sync --frozen --all-extras --dev
27+
28+
- name: Run pyright
29+
run: uv run --frozen 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", "pytest>=8"]
30+
2831
[tool.ruff.lint]
2932
select = ["E", "F", "I"]
3033
ignore = []

0 commit comments

Comments
 (0)