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.

precommit: Create .ocamlformat regardless of --force flag

The previous logic skipped creating .ocamlformat when --force was used,
which was backwards. Now it always creates .ocamlformat if missing when
fmt hooks are requested.

+2 -2
+2 -2
lib/precommit.ml
··· 136 136 chmod_exec ~dry_run commit_msg_path 137 137 end; 138 138 139 - (* Create .ocamlformat if missing and fmt hooks requested and not forcing *) 140 - if hooks.fmt && (not force) && not (file_exists ~fs ocamlformat_path) then 139 + (* Create .ocamlformat if missing and fmt hooks requested *) 140 + if hooks.fmt && not (file_exists ~fs ocamlformat_path) then 141 141 write_file ~fs ~dry_run ocamlformat_path default_ocamlformat; 142 142 143 143 Ok ()