From e32bf07433f60702dfb3269bb3a40bddaa55c51f Mon Sep 17 00:00:00 2001 From: David Soria Parra Date: Fri, 3 Jan 2025 15:57:56 +0000 Subject: [PATCH] docs: Update CLAUDE.md with ruff and pre-commit info --- CLAUDE.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/CLAUDE.md b/CLAUDE.md index c501926..ef75f97 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -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