Installs pre-commit hooks for OCaml projects that run dune fmt automatically
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(precommit): update init.t cram test expectations

Promote cram test output to match current precommit init behavior:
absolute paths in dry-run, proper error messages and exit codes for
missing git repos and OCaml projects.

+9 -7
+9 -7
test/init.t
··· 8 8 9 9 Test dry-run mode shows what would be created 10 10 $ precommit init --dry-run 11 - Would create ./.git/hooks/ 12 - Would create ./.git/hooks/pre-commit 13 - Would chmod +x ./.git/hooks/pre-commit 14 - Would create ./.git/hooks/commit-msg 15 - Would chmod +x ./.git/hooks/commit-msg 11 + Would create $TESTCASE_ROOT/test-project/.git/hooks/ 12 + Would create $TESTCASE_ROOT/test-project/.git/hooks/pre-commit 13 + Would chmod +x $TESTCASE_ROOT/test-project/.git/hooks/pre-commit 14 + Would create $TESTCASE_ROOT/test-project/.git/hooks/commit-msg 15 + Would chmod +x $TESTCASE_ROOT/test-project/.git/hooks/commit-msg 16 16 Would create ./.ocamlformat 17 17 ℹ Would initialise . 18 18 ✓ Processed 1 directory ··· 44 44 $ cd no-git-$$ 45 45 $ echo '(lang dune 3.0)' > dune-project 46 46 $ precommit init 47 - ℹ All directories already have hooks installed 47 + ✗ No git repositories found 48 + [1] 48 49 49 50 Test error when not in an OCaml project 50 51 $ cd /tmp ··· 52 53 $ cd no-dune-$$ 53 54 $ git init -q 54 55 $ precommit init 55 - ℹ All directories already have hooks installed 56 + ℹ No OCaml projects found (use --force to install anyway) 57 + [1]