Skip to content

Latest commit

 

History

History
75 lines (54 loc) · 1.61 KB

File metadata and controls

75 lines (54 loc) · 1.61 KB

Contributing to C4 Literate Python

Thank you for your interest in contributing!

Development Setup

# Clone repository
git clone https://github.com/yourusername/c4-literate-python.git
cd c4-literate-python

# Create virtual environment
python3.12 -m venv venv
source venv/bin/activate  # or `venv\Scripts\activate` on Windows

# Install in development mode
pip install -e ".[dev]"

# Run tests
pytest

Running Tests

# Run all tests
pytest

# Run with coverage
pytest --cov=c4_literate --cov-report=html

# Run specific test file
pytest tests/test_parser.py

Code Style

  • Follow PEP 8
  • Maximum line length: 79 characters
  • Use type hints where appropriate
  • Write docstrings for public functions

Adding New Annotations

  1. Add to c4-annotations-schema.yaml
  2. Update extractor.py if needed
  3. Update model.py to handle new annotation type
  4. Regenerate documentation: make docs
  5. Add tests
  6. Update README examples

Important: Always edit the YAML schema file, not SCHEMA.md directly. SCHEMA.md is auto-generated from the YAML.

Submitting Changes

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Add tests for new functionality
  5. Ensure tests pass (pytest)
  6. Commit your changes (git commit -m 'Add amazing feature')
  7. Push to branch (git push origin feature/amazing-feature)
  8. Open a Pull Request

Reporting Issues

  • Use GitHub Issues
  • Include Python version
  • Provide example code that demonstrates the issue
  • Include error messages and stack traces

Questions?

Open a GitHub Discussion or issue!