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): reduce nesting depth to ≤4 (E010)

Extract helpers to reduce deep nesting in 7 functions:
- display_ai_commits: extract make_commit_row helper
- write_query: extract write_values helper
- of_identifier: extract parse_params_loop, extract_query_name,
make_derived_component, resolve_ident_with_params
- verify: move check_not_future/check_max_age_helper to module level,
flatten nested match with Option.fold
- decode (h2_hpack): remove begin/end, compound saw_first_header guard
- request (one.ml): extract make_h2_direct_response helper
- request_internal: extract make_h2_conn_response/make_h2_alpn_response

+16 -19
+16 -19
bin/main.ml
··· 243 243 244 244 (* Shared: find AI commits across dirs and display a unified table. 245 245 Returns [(affected_dirs, total_commits, repos_with_issues)]. *) 246 + let make_commit_row subject_max d first (c : Precommit.ai_commit) = 247 + let project_cell = 248 + if !first then begin 249 + first := false; 250 + Tty.Span.styled Tty.Style.bold d 251 + end 252 + else Tty.Span.text "" 253 + in 254 + [ 255 + project_cell; 256 + Tty.Span.styled Tty.Style.(fg Tty.Color.yellow) c.hash; 257 + Tty.Span.text (truncate_subject subject_max c.subject); 258 + ] 259 + 246 260 let display_ai_commits ctx dirs = 247 261 let term_width = terminal_width () in 248 262 let subject_max = max 20 (term_width - 35) in ··· 258 272 total_commits := !total_commits + List.length commits; 259 273 affected_dirs := d :: !affected_dirs; 260 274 let first = ref true in 261 - List.iter 262 - (fun (c : Precommit.ai_commit) -> 263 - let project_cell = 264 - if !first then begin 265 - first := false; 266 - Tty.Span.styled Tty.Style.bold d 267 - end 268 - else Tty.Span.text "" 269 - in 270 - all_rows := 271 - !all_rows 272 - @ [ 273 - [ 274 - project_cell; 275 - Tty.Span.styled Tty.Style.(fg Tty.Color.yellow) c.hash; 276 - Tty.Span.text (truncate_subject subject_max c.subject); 277 - ]; 278 - ]) 279 - commits 275 + let rows = List.map (make_commit_row subject_max d first) commits in 276 + all_rows := !all_rows @ rows 280 277 end) 281 278 dirs; 282 279 if !all_rows <> [] then begin