Thanks for considering a contribution to EcoCode.
If you encounter a bug, have an improvement idea, or want a new feature, feel free to open a discussion or submit a PR. All constructive contributions are welcome.
- Create and activate a virtual environment.
- Install package in editable mode with dev tools:
python -m pip install -e .python -m pip install pytest
- Run tests with
.venv/bin/python -m pytest -q.
Before opening a PR, contributors must validate that the project is healthy locally:
- Ensure the package installs in editable mode:
.venv/bin/python -m pip install -e .
- Ensure tests pass:
.venv/bin/python -m pytest -q
- Ensure Python sources compile:
.venv/bin/python -m compileall src
- Re-run the CLI quickly to catch obvious regressions:
.venv/bin/ecocode --help.venv/bin/ecocode profile path/to/script.py --json.venv/bin/ecocode profile path/to/script.py --collector runtime --json.venv/bin/ecocode profile path/to/script.py --collector runtime --runs 3 --json.venv/bin/ecocode profile path/to/script.py --collector runtime --runs 3 --max-energy-cv-pct 30 --fail-on-unstable --json.venv/bin/ecocode profile-repo --root . --ext .py --include-glob "src/**/*.py" --exclude-glob "tests/*.py" --json- For subprocess-heavy changes, add a small runtime smoke check that spawns a child process.
- Confirm JSON output still passes the internal schema checks for profile, baseline, repo, and trend commands.
PRs should be opened only after these checks pass.
- Create a branch:
feat/<short-name>orfix/<short-name>. - Keep PRs focused and small.
- Add or update tests for behavior changes.
- Run the Local Quality Gate checks.
- Open a PR with context, approach, and before/after behavior.
Use conventional commits:
feat: add cpu profiler samplerfix: handle missing script in profile commandtest: add coverage for baseline regressiondocs: expand roadmap phase 2 milestones