Run your CI gates locally, before you push. greenlight fails on your machine in five seconds instead of on github in five minutes.
i got tired of pushing, alt-tabbing to the actions tab, and watching lint fail on something i could've caught locally. so: a pre-push hook that runs the same gates CI runs, in parallel, and blocks the push if any of them are red.
pip install greenlight-cligreenlight init # writes a starter .greenlight.yml
greenlight run # run every gate right now
greenlight install-hook # block `git push` unless everything is green.greenlight.yml:
parallel: true
gates:
- name: lint
run: ruff check .
- name: types
run: mypy .
allow_fail: true # runs, but won't block the push
- name: tests
run: pytest -quse both. CI is the source of truth. greenlight is the fast feedback loop so CI stops being the thing that tells you that you forgot to run the tests.
MIT