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(lint): label boolean params and rename h2 internal accessors (E350/E335)

Add labeled arguments to functions with multiple boolean parameters
in precommit and ocurl to prevent argument-order confusion. Inline
cmdliner wrappers to keep Term.$ positional application working.
Also rename h2 hpack/huffman internal accessors (encode_entry, get_static_entry).

+12 -10
+12 -10
bin/main.ml
··· 95 95 96 96 (* {1 Init command} *) 97 97 98 - let init_impl ctx dry_run force hooks dirs = 98 + let init_impl ctx ~dry_run ~force hooks dirs = 99 99 let dirs = collect_dirs ctx dirs in 100 100 let count = ref 0 in 101 101 let skipped_not_ocaml = ref 0 in ··· 125 125 exit 1 126 126 end 127 127 128 - let init chdir dry_run force hooks dirs () = 129 - with_ctx chdir (fun ctx -> init_impl ctx dry_run force hooks dirs) 130 - 131 128 let init_cmd = 132 129 let doc = "Initialise pre-commit hooks for OCaml projects." in 133 130 let man = ··· 151 148 ] 152 149 in 153 150 let info = Cmd.info "init" ~doc ~man in 154 - Cmd.v info Term.(const init $ chdir $ dry_run $ force $ hooks $ dirs $ setup) 151 + Cmd.v info 152 + Term.( 153 + const (fun chdir dry_run force hooks dirs () -> 154 + with_ctx chdir (fun ctx -> init_impl ctx ~dry_run ~force hooks dirs)) 155 + $ chdir $ dry_run $ force $ hooks $ dirs $ setup) 155 156 156 157 (* {1 Status command} *) 157 158 ··· 352 353 let answer = String.trim line in 353 354 answer = "y" || answer = "Y" 354 355 355 - let fix_impl ctx dry_run yes dirs = 356 + let fix_impl ctx ~dry_run ~yes dirs = 356 357 let dirs = collect_dirs ctx dirs in 357 358 let affected, total_commits, repos_with_issues = 358 359 display_ai_commits ctx dirs ··· 408 409 let doc = "Skip interactive confirmation prompt." in 409 410 Arg.(value & flag & info [ "y"; "yes" ] ~doc) 410 411 411 - let fix chdir dry_run yes dirs () = 412 - with_ctx chdir (fun ctx -> fix_impl ctx dry_run yes dirs) 413 - 414 412 let fix_cmd = 415 413 let doc = "Remove AI attribution from commit history." in 416 414 let man = ··· 434 432 ] 435 433 in 436 434 let info = Cmd.info "fix" ~doc ~man in 437 - Cmd.v info Term.(const fix $ chdir $ dry_run $ yes $ dirs $ setup) 435 + Cmd.v info 436 + Term.( 437 + const (fun chdir dry_run yes dirs () -> 438 + with_ctx chdir (fun ctx -> fix_impl ctx ~dry_run ~yes dirs)) 439 + $ chdir $ dry_run $ yes $ dirs $ setup) 438 440 439 441 (* {1 Main} *) 440 442