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.

Merge commit '06b3e55576da341e13228f21523b47911f9fe67c'

# Conflicts:
# ocaml-matter/dune-project
# ocaml-matter/lib/crypto.ml
# ocaml-matter/lib/dune
# ocaml-matter/lib/pase.ml
# ocaml-matter/lib/session.ml
# ocaml-matter/matter.opam

+9 -9
+9 -9
lib/precommit.ml
··· 32 32 33 33 let commit_msg_hook = 34 34 {|#!/bin/sh 35 - # Check commit message for emojis and remove Claude attribution lines 35 + # Check commit message for emojis and remove AI attribution lines 36 36 37 37 COMMIT_MSG_FILE="$1" 38 38 ··· 42 42 exit 1 43 43 fi 44 44 45 - # Remove lines containing 'claude' (case-insensitive) 46 - if grep -qi 'claude' "$COMMIT_MSG_FILE"; then 47 - # Use sed to filter out claude lines in-place 45 + # Remove AI attribution lines (Co-Authored-By: Claude or similar patterns) 46 + if grep -qiE 'Co-Authored-By:.*[Cc]laude' "$COMMIT_MSG_FILE"; then 47 + # Use sed to filter out AI attribution lines in-place 48 48 if [ "$(uname)" = "Darwin" ]; then 49 - sed -i '' '/[Cc][Ll][Aa][Uu][Dd][Ee]/d' "$COMMIT_MSG_FILE" 49 + sed -i '' '/[Cc]o-[Aa]uthored-[Bb]y:.*[Cc]laude/d' "$COMMIT_MSG_FILE" 50 50 else 51 - sed -i '/[Cc][Ll][Aa][Uu][Dd][Ee]/d' "$COMMIT_MSG_FILE" 51 + sed -i '/[Cc]o-[Aa]uthored-[Bb]y:.*[Cc]laude/d' "$COMMIT_MSG_FILE" 52 52 fi 53 53 fi 54 54 ··· 190 190 let check_ai_attribution dir = 191 191 if not (file_exists (Filename.concat dir ".git")) then [] 192 192 else 193 - (* Get commits by the configured user that contain "claude" *) 193 + (* Get commits by the configured user that contain AI attribution patterns *) 194 194 let cmd = 195 - "git log --format='%h %s' --grep='[Cc]laude' --author=\"$(git config \ 196 - user.name)\" 2>/dev/null" 195 + "git log --format='%h %s' --grep='Co-Authored-By.*[Cc]laude' \ 196 + --author=\"$(git config user.name)\" 2>/dev/null" 197 197 in 198 198 let lines = run_in_dir dir cmd in 199 199 List.filter_map