docs: Update CLAUDE.md with ruff and pre-commit info

This commit is contained in:
David Soria Parra
2025-01-03 15:57:56 +00:00
parent e21e8c157d
commit e32bf07433

View File

@@ -29,10 +29,15 @@ This file is intended to be used by an LLM such as Claude.
- Handles both formatting and linting
- For formatting: `uv run ruff format .`
- For checking: `uv run ruff check .`
- For auto-fixing: `uv run ruff check . --fix`
- Common issues:
- Line length (default 88 chars)
- Import sorting
- Import sorting (I001 errors)
- 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
- 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
- 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
1. Always check git status and diff before committing