Contributing¶
Contributions are welcome! This guide covers the development workflow.
Development Setup¶
git clone https://github.com/montanarograziano/spark_plan_viz.git
cd spark_plan_viz
just install # Install all dependencies
just pre-commit # Set up pre-commit hooks
Development Workflow¶
Running Tests¶
just test # Run tests on current Python
just test-python 3.12 # Run on specific version
just test-all # Run on Python 3.11, 3.12, 3.13
Code Quality¶
Commit Messages¶
Use Conventional Commits:
feat:— new featurefix:— bug fixdocs:— documentationtest:— testsrefactor:— code restructuringchore:— maintenance
Pull Request Process¶
- Fork the repository
- Create a feature branch from
main - Make your changes
- Run
just checkandjust test - Push and open a PR
PR Checklist¶
- Tests added/updated
- Lint and type checks pass
- Conventional commit messages used
- Breaking changes documented
Project Structure¶
src/spark_plan_viz/
__init__.py # Public API exports
_constants.py # Named constants
_types.py # TypedDict definitions
_extractors.py # Regex-based extraction functions
_parser.py # JVM plan traversal via Py4J
_renderer.py # HTML generation and visualize_plan()
_rules.py # 15 optimization rules
_analyzer.py # Analysis engine
template.html # D3.js visualization template
tests/
test_parsing.py # Extraction function tests
test_visualize_plan.py # Parser, renderer, integration tests
test_rules.py # One test per optimization rule
docs/ # Zensical documentation source
Adding a New Optimization Rule¶
- Create a class in
_rules.pyimplementing theRuleprotocol - Add it to the
ALL_RULESlist - Add tests in
test_rules.py - Document it in
docs/optimization-reference/index.md