mirror of
https://github.com/aljazceru/mcp-python-sdk.git
synced 2025-12-19 14:54:24 +01:00
docs: Update CLAUDE.md with ruff and pre-commit info
This commit is contained in:
19
CLAUDE.md
19
CLAUDE.md
@@ -29,10 +29,15 @@ This file is intended to be used by an LLM such as Claude.
|
|||||||
- Handles both formatting and linting
|
- Handles both formatting and linting
|
||||||
- For formatting: `uv run ruff format .`
|
- For formatting: `uv run ruff format .`
|
||||||
- For checking: `uv run ruff check .`
|
- For checking: `uv run ruff check .`
|
||||||
|
- For auto-fixing: `uv run ruff check . --fix`
|
||||||
- Common issues:
|
- Common issues:
|
||||||
- Line length (default 88 chars)
|
- Line length (default 88 chars)
|
||||||
- Import sorting
|
- Import sorting (I001 errors)
|
||||||
- Unused imports
|
- Unused imports
|
||||||
|
- When line length errors occur:
|
||||||
|
- For strings, use parentheses and line continuation
|
||||||
|
- For function calls, use multiple lines with proper indentation
|
||||||
|
- For imports, split into multiple lines
|
||||||
|
|
||||||
### Pyright
|
### Pyright
|
||||||
- Type checker
|
- Type checker
|
||||||
@@ -42,6 +47,18 @@ This file is intended to be used by an LLM such as Claude.
|
|||||||
- Optional types need explicit None checks
|
- Optional types need explicit None checks
|
||||||
- String operations need type narrowing
|
- String operations need type narrowing
|
||||||
|
|
||||||
|
## Pre-commit Hooks
|
||||||
|
|
||||||
|
- Configuration in `.pre-commit-config.yaml`
|
||||||
|
- Runs automatically on git commit
|
||||||
|
- Includes:
|
||||||
|
- Prettier for YAML/JSON formatting
|
||||||
|
- Ruff for Python formatting and linting
|
||||||
|
- When updating ruff version:
|
||||||
|
- Check available versions on PyPI
|
||||||
|
- Update `rev` in config to match available version
|
||||||
|
- Add and commit config changes before other changes
|
||||||
|
|
||||||
## Best Practices
|
## Best Practices
|
||||||
|
|
||||||
1. Always check git status and diff before committing
|
1. Always check git status and diff before committing
|
||||||
|
|||||||
Reference in New Issue
Block a user