Thank you for considering contributing to AlphaFlow! This document provides guidelines for contributing to the project.
Be respectful, professional, and constructive in all interactions.
- Fork the repository
- Clone your fork:
git clone https://github.com/yourusername/AlphaFlow.git - Create a feature branch:
git checkout -b feature/your-feature-name - Make your changes
- Test thoroughly
- Submit a pull request
# Create virtual environment
python3 -m venv .venv
source .venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Install development dependencies
pip install pytest pytest-cov black ruff mypy
# Install in editable mode
pip install -e .- Formatting: Black (line length 100)
- Linting: Ruff, Flake8
- Type Hints: Required for all public functions
- Docstrings: Google style
# Format with black
black app/ core/ --line-length 100
# Lint with ruff
ruff check app/ core/
# Type check with mypy
mypy app/ core/ --strict- Place tests in
tests/test_core/ortests/test_app/ - Use pytest fixtures for reusable test data
- Aim for 70%+ code coverage
- Test edge cases and error handling
# Run all tests
pytest tests/ -v
# Run with coverage
pytest tests/ --cov=core --cov=app --cov-report=html
# Run specific test file
pytest tests/test_core/test_indicators.py -v- Update Documentation - Update README.md if needed
- Add Tests - New features require tests
- Check Style - Run black, ruff, mypy
- Run Tests - All tests must pass
- Update CHANGELOG - Document your changes
- Submit PR - Provide clear description
[Type] Brief description
Types:
- feat: New feature
- fix: Bug fix
- docs: Documentation update
- style: Code style changes
- refactor: Code refactoring
- test: Adding tests
- chore: Maintenance tasks
feat: Add support for limit orders in order manager
- Implemented limit order type in OrderManager
- Added validation for limit price
- Updated UI to support limit orders
- Added tests for limit order functionality
AlphaFlow/
├── core/ # Trading engine (business logic)
├── app/ # UI layer (PyQt6)
│ ├── widgets/ # Reusable UI components
│ ├── pages/ # Page/tab implementations
│ ├── controllers/# Business logic orchestration
│ └── styles/ # Theming
├── tests/ # Test suite
└── scripts/ # Build and utility scripts
- core/ - Pure Python, no UI dependencies
- app/ - UI layer, depends on core
- widgets/ - Reusable UI components
- pages/ - Full page implementations
- controllers/ - Coordinate between UI and core
- Keep functions small - Single responsibility
- Use type hints - Enable static type checking
- Document thoroughly - Docstrings for public APIs
- Handle errors gracefully - User-friendly error messages
- Test thoroughly - Unit and integration tests
- Check existing issues
- Test with latest version
- Gather logs from
logs/directory
**Describe the bug**
A clear description of the bug.
**To Reproduce**
Steps to reproduce:
1. Go to...
2. Click on...
3. See error...
**Expected behavior**
What you expected to happen.
**Environment:**
- macOS version:
- Python version:
- AlphaFlow version:
**Logs**
Attach relevant logs from `logs/` directory.
Suggest features via GitHub Issues. Include:
- Use case - Why is this needed?
- Proposed solution - How should it work?
- Alternatives - Other approaches considered
- Open a GitHub Discussion
- Email: support@alphaflow.com
Thank you for contributing to AlphaFlow!