Bite before you commit: a pre-commit hook
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 85/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- git, python, yaml
- Domain
- documentation, tooling
Research direction
Create .pre-commit-hooks.yaml at the repo root with a bite-live hook that runs bite live. Edit README to add the config lines and explain the double test run and git commit --no-verify skip. Verify by adding the hook to a test project and confirming bite live runs on commit. Done when README documents setup and the hook works.
Written by the indexing model from the issue text.
Description
Size: small to medium. An afternoon. No API key needed.
What and why
pre-commit runs checks on every git commit in thousands of projects. bite live already checks the changes you haven't committed yet: it takes them out of a copy and runs your tests. If a hook ran bite live, people would get Bite on every commit without thinking about it: "you changed this, and no test would notice if it vanished."
What to do
- Add
.pre-commit-hooks.yamlat the top of this repo:- id: bite-live name: Bite (would a test notice this change?) entry: bite live language: python pass_filenames: false always_run: truepass_filenames: falsematters:bite liveworks out the changes itself, and the file names pre-commit would add aren't options it knows. - In
README.md, under "Check Claude's "fixed" live", add a short "Before every commit (pre-commit)" part with the lines a project puts in its.pre-commit-config.yaml:repos: - repo: https://github.com/connabyss/bite rev: v1.0.5 # the first release that has the hook; use the newest hooks: - id: bite-live - The README part must say these plainly:
- It checks only the change you're committing, not old commits.
- It runs your tests twice (with the change, then without), so each commit waits about twice as long as your tests take.
free_test_commandin.bite.inican point it at a faster subset. - When no test notices the change,
bite liveexits with 1 and the commit stops. To skip it once:git commit --no-verify. - It also counts new files you haven't added to git (pre-commit doesn't hide those), so keep scratch files out of the project folder or in
.gitignore.
Done when
- A test in
tests/reads.pre-commit-hooks.yamlas text and checks the id isbite-live, the entry isbite live, andpass_filenames: falseis there (no YAML package needed, Bite has no dependencies). - You tried it for real on a scratch repo with
pre-commit try-repo <path to your bite clone> bite-live --all-files, once where a test notices (passes) and once where none does (stops the commit), and pasted both outputs into the PR. - The README part has the setup lines and the four points above.
Heads-up: on a brand-new repo with no commits yet, bite live currently says "--since HEAD isn't a commit" and stops the very first commit. That's #173; if nobody has fixed it yet, mention it in your PR rather than fixing both.
New here? CONTRIBUTING.md has setup (pip install -e .[test], then python -m pytest). Comment to claim it.
- Dominant language
- Python
- Stars
- 1
- Forks
- 5
- Avg merge
- 1h 19m
- Merged PRs (30d)
- 191
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from connabyss/bite
-
documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Maintainers usually reply within 1 day
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Write --roast lines for the four results that don't have onePossibly taken @abhishekrajv7-cmd claimed this 8 days ago. Opengood first issue
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
Maintainers usually reply within 1 day
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
Similar issues
-
bug bugfix
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
simplify
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
drevendev/Devostasis#158 · 1 comment ·
-
Elko Super TR: temperature stops updating once the thermostat reports its active sensorPossibly taken @zigpy-review-bot claimed this today. Openbot: code audit
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
zigpy/zha-device-handlers#5790 ·
Maintainers usually reply within 1 day
-
source defect
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
mampfes/hacs_waste_collection_schedule#8269 ·
Maintainers usually reply within 1 day