MCPcopy Create free account
hub / github.com/elastio/devx / run_hook

Function run_hook

xtask/src/pre_commit.rs:4–9  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2use devx_pre_commit::PreCommitContext;
3
4pub fn run_hook() -> Result<()> {
5 let ctx = PreCommitContext::from_git_diff(crate::project_root_dir())?;
6 ctx.rustfmt()?;
7 ctx.stage_new_changes()?;
8 Ok(())
9}
10
11pub fn install_hook() -> Result<()> {
12 devx_pre_commit::install_self_as_hook(crate::project_root_dir())?;

Callers 1

mainFunction · 0.85

Calls 3

project_root_dirFunction · 0.85
rustfmtMethod · 0.80
stage_new_changesMethod · 0.80

Tested by

no test coverage detected