This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
- Install dependencies:
make install
orpoetry install
- Create virtual environment:
make venv
orpython3 -m venv venv
- Format code:
make format
orpoetry run black . && poetry run isort .
- Lint code:
make lint
orpoetry run flake8 . && poetry run mypy .
- Type check:
make typecheck
orpoetry run mypy .
- Run all tests:
make test
orpoetry run pytest tests/
- Run single test file:
make test-file FILE=tests/test_file.py
orpoetry run pytest tests/test_file.py -v
- Run single test function:
make test-function FILE=tests/test_file.py::test_function
orpoetry run pytest tests/test_file.py::TestClass::test_method -v
- Run tests in exercises:
cd exercises && poetry run pytest test_file.py
- Use Python 3.11+ features and syntax
- Follow PEP 8 style guidelines with Black (line-length=88) and isort
- Use strict type hints throughout (mypy with disallow_untyped_defs=true)
- Use snake_case for variables/functions, PascalCase for classes
- Organize imports: standard library, third-party, local
- Include docstrings for all modules, classes, and functions
- Use context managers for resource handling
- Raise specific exceptions with descriptive messages
- Validate input parameters with assertions or value checks
- Structure code using modules and packages appropriately
The repository includes a simple language implementation with lexer, parser, and evaluator supporting functional programming constructs and reflection capabilities.