axodotdev / axodotdev/cargo-dist
Add pre-commit hook option to `cargo dist init`
- Dominant language
- Rust
- Stars
- 2.1k
- Forks
- 149
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 32
Description
To avoid issues with updates to the project configuration failing in CI because `cargo dist generate` wasn't run. It would be nice to have an option to install a pre-commit hook when running `cargo dist init`. A new option could be added to append a pre-commit hook to the local configuration?
I am thinking maybe something like
```console
cargo dist init --install-precommit-hook
cat ./.git/hooks/pre-commit
#!/bin/sh
cargo dist generate --check
```
Contributor guide
Research direction
Start at the `cargo dist init` entry point and inspect how it handles project configuration, then review the `.git/hooks/pre-commit` location and the `cargo dist generate --check` command. Done means the option installs or appends the requested hook without disrupting existing configuration, and the generated configuration check runs from the hook.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, rust
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100