From 11162d7790a5ece766e479542f8b147ba0471e1c Mon Sep 17 00:00:00 2001 From: Stanley Law Date: Thu, 17 Jul 2025 20:17:59 +0800 Subject: [PATCH] docs: add pre-commit install guide on CONTRIBUTING.md (#995) Co-authored-by: Felix Weinberger --- CONTRIBUTING.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fe78cf25..c18937f5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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