docs: add pre-commit install guide on CONTRIBUTING.md (#995)

Co-authored-by: Felix Weinberger <fweinberger@anthropic.com>
This commit is contained in:
Stanley Law 2025-07-17 20:17:59 +08:00 • committed by GitHub
commit 11162d7790
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -14,6 +14,12 @@ Thank you for your interest in contributing to the MCP Python SDK! This document
uv sync --frozen --all-extras --dev
```
6. Set up pre-commit hooks:
```bash
uv tool install pre-commit --with pre-commit-uv --force-reinstall
```
## Development Workflow
1. Choose the correct branch for your changes:
@ -50,7 +56,13 @@ uv run ruff format .
uv run scripts/update_readme_snippets.py
```
8. Submit a pull request to the same branch you branched from
8. (Optional) Run pre-commit hooks on all files:
```bash
pre-commit run --all-files
```
9. Submit a pull request to the same branch you branched from
## Code Style