Skip to content

Commit 6a9d811

Browse files
Add CLAUDE.md with development guidance
Add development documentation for Claude Code (claude.ai/code) including: - Project overview - Development commands using uv - Development process guidelines - Core architecture overview Also add Claude settings to allow running approved commands directly. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 6c9d274 commit 6a9d811

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed

.claude/settings.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash(uv run pytest:*)",
5+
"Bash(git add:*)",
6+
"Bash(uv run mypy:*)",
7+
"Bash(uv run pre-commit:*)"
8+
9+
],
10+
"deny": []
11+
}
12+
}

CLAUDE.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Project Overview
6+
7+
Pluggy is a minimalist production-ready plugin system that serves as the core framework for pytest, datasette and devpi.
8+
It provides hook specification and implementation mechanisms through a plugin manager system.
9+
10+
## Development Commands
11+
12+
All commands use `uv run` for consistent environments.
13+
14+
### Testing
15+
- `uv run pytest` - Run all tests (prefer running all tests for quick feedback)
16+
- `uv run pytest testing/benchmark.py` - Run benchmark tests
17+
18+
### Code Quality
19+
- `uv run pre-commit run -a` - Run all pre-commit hooks (linting, formatting, type checking)
20+
- Always reread files modified by pre-commit
21+
22+
## Development Process
23+
24+
- Always read `src/pluggy/*.py` to get a full picture
25+
- Consider backward compatibility
26+
- Always run all tests: `uv run pytest`
27+
- Always run pre-commit before committing: `uv run pre-commit run -a`
28+
- Prefer running full pre-commit over individual tools (ruff/mypy)
29+
30+
31+
32+
## Core Architecture
33+
34+
### Main Components
35+
36+
- **PluginManager** (`src/pluggy/_manager.py`): Central registry that manages plugins and coordinates hook calls
37+
- **HookCaller** (`src/pluggy/_hooks.py`): Executes hook implementations with proper argument binding
38+
- **HookImpl/HookSpec** (`src/pluggy/_hooks.py`): Represent hook implementations and specifications
39+
- **Result** (`src/pluggy/_result.py`): Handles hook call results and exception propagation
40+
- **Multicall** (`src/pluggy/_callers.py`): Core execution engine for calling multiple hook implementations
41+
42+
### Package Structure
43+
- `src/pluggy/` - Main package source
44+
- `testing/` - Test suite using pytest
45+
- `docs/` - Sphinx documentation and examples
46+
- `changelog/` - Towncrier fragments for changelog generation
47+
48+
## Configuration Files
49+
- `pyproject.toml` - Project metadata, build system, tool configuration (ruff, mypy, setuptools-scm)
50+
- `tox.ini` - Multi-environment testing configuration
51+
- `.pre-commit-config.yaml` - Code quality automation (ruff, mypy, flake8, etc.)

0 commit comments

Comments
 (0)