Skip to content

Commit c9204f7

Browse files
committed
refactor: integrate markdownlint with pyproject.toml
1 parent 357bd2e commit c9204f7

File tree

5 files changed

+44
-27
lines changed

5 files changed

+44
-27
lines changed

.markdownlint.yaml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.pre-commit-config.yaml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,18 @@ repos:
77
- id: prettier
88
types_or: [yaml, json5]
99

10-
- repo: https://github.com/DavidAnson/markdownlint-cli2
11-
rev: v0.18.1
10+
- repo: https://github.com/igorshubovych/markdownlint-cli
11+
rev: v0.45.0
1212
hooks:
13-
- id: markdownlint-cli2
14-
args: ["--fix"]
13+
- id: markdownlint
14+
args:
15+
[
16+
"--fix",
17+
"--config",
18+
"pyproject.toml",
19+
"--configPointer",
20+
"/tool/markdown/lint",
21+
]
1522
types: [markdown]
1623

1724
- repo: local

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ uv run ruff format .
4545
```
4646

4747
7. Update README snippets if you modified example code:
48+
4849
```bash
4950
uv run scripts/update_readme_snippets.py
5051
```

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ def get_settings() -> str:
235235
"debug": false
236236
}"""
237237
```
238+
238239
_Full example: [examples/snippets/servers/basic_resource.py](https://github.com/modelcontextprotocol/python-sdk/blob/main/examples/snippets/servers/basic_resource.py)_
239240
<!-- /snippet-source -->
240241

@@ -261,6 +262,7 @@ def get_weather(city: str, unit: str = "celsius") -> str:
261262
# This would normally call a weather API
262263
return f"Weather in {city}: 22degrees{unit[0].upper()}"
263264
```
265+
264266
_Full example: [examples/snippets/servers/basic_tool.py](https://github.com/modelcontextprotocol/python-sdk/blob/main/examples/snippets/servers/basic_tool.py)_
265267
<!-- /snippet-source -->
266268

@@ -411,6 +413,7 @@ def debug_error(error: str) -> list[base.Message]:
411413
base.AssistantMessage("I'll help debug that. What have you tried so far?"),
412414
]
413415
```
416+
414417
_Full example: [examples/snippets/servers/basic_prompt.py](https://github.com/modelcontextprotocol/python-sdk/blob/main/examples/snippets/servers/basic_prompt.py)_
415418
<!-- /snippet-source -->
416419

@@ -460,6 +463,7 @@ async def long_running_task(task_name: str, ctx: Context, steps: int = 5) -> str
460463

461464
return f"Task '{task_name}' completed"
462465
```
466+
463467
_Full example: [examples/snippets/servers/tool_progress.py](https://github.com/modelcontextprotocol/python-sdk/blob/main/examples/snippets/servers/tool_progress.py)_
464468
<!-- /snippet-source -->
465469

@@ -547,6 +551,7 @@ async def handle_completion(
547551

548552
return None
549553
```
554+
550555
_Full example: [examples/snippets/servers/completion.py](https://github.com/modelcontextprotocol/python-sdk/blob/main/examples/snippets/servers/completion.py)_
551556
<!-- /snippet-source -->
552557
### Elicitation
@@ -597,6 +602,7 @@ async def book_table(
597602
# Date available
598603
return f"[SUCCESS] Booked for {date} at {time}"
599604
```
605+
600606
_Full example: [examples/snippets/servers/elicitation.py](https://github.com/modelcontextprotocol/python-sdk/blob/main/examples/snippets/servers/elicitation.py)_
601607
<!-- /snippet-source -->
602608

@@ -637,6 +643,7 @@ async def generate_poem(topic: str, ctx: Context) -> str:
637643
return result.content.text
638644
return str(result.content)
639645
```
646+
640647
_Full example: [examples/snippets/servers/sampling.py](https://github.com/modelcontextprotocol/python-sdk/blob/main/examples/snippets/servers/sampling.py)_
641648
<!-- /snippet-source -->
642649

@@ -665,6 +672,7 @@ async def process_data(data: str, ctx: Context) -> str:
665672

666673
return f"Processed: {data}"
667674
```
675+
668676
_Full example: [examples/snippets/servers/notifications.py](https://github.com/modelcontextprotocol/python-sdk/blob/main/examples/snippets/servers/notifications.py)_
669677
<!-- /snippet-source -->
670678

pyproject.toml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,27 @@ filterwarnings = [
126126
"ignore:websockets.server.WebSocketServerProtocol is deprecated:DeprecationWarning",
127127
"ignore:Returning str or bytes.*:DeprecationWarning:mcp.server.lowlevel",
128128
]
129+
130+
[tool.markdown.lint]
131+
default=true
132+
133+
# MD004 ul-style - Unordered list style
134+
MD004=false
135+
136+
# MD007 ul-indent - Unordered list indentation
137+
MD007.indent=2
138+
139+
# MD013 line-length - Line length
140+
MD013=false
141+
142+
# MD029 ol-prefix - Ordered list item prefix
143+
MD029=false
144+
145+
# MD033 no-inline-html Inline HTML
146+
MD033=false
147+
148+
# MD041 first-line-heading/first-line-h1
149+
MD041=false
150+
151+
# MD059 descriptive-link-text
152+
MD059=false

0 commit comments

Comments
 (0)