Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .githooks/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

msg=$(head -1 "$1")

# Allow git-generated messages (merge, revert, etc.)
if echo "$msg" | grep -qE '^(Merge|Revert|Rebase|fixup!|squash!|amend!) '; then
exit 0
fi

# Allow WIP/SAVEPOINT/WIPE from aliases
if echo "$msg" | grep -qE '^(WIP|SAVEPOINT|WIPE SAVEPOINT)$'; then
exit 0
fi
Comment thread
coderabbitai[bot] marked this conversation as resolved.

# Conventional Commits: type(scope): desc or type: desc
if ! echo "$msg" | grep -qE '^[a-z]+(\([a-z0-9._-]+\))?!?: .+'; then
echo "ERROR: commit message must follow Conventional Commits"
echo ""
echo " type: description"
echo " type(scope): description"
echo ""
echo " types: feat fix docs style refactor perf test build ci chore revert"
echo ""
echo " got: $msg"
exit 1
fi
11 changes: 11 additions & 0 deletions .gitmessage
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

# Conventional Commits — type(scope): description
#
# types: feat fix docs style refactor perf test build ci chore revert
# scope: optional, lowercase (e.g. fish, git, aerospace)
# description: imperative, lowercase, no period
#
# examples:
# feat: add nightshift to my setup
# fix(fish): correct path ordering
# chore: update brewfile dependencies
1 change: 1 addition & 0 deletions git/config
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
program = /Applications/1Password.app/Contents/MacOS/op-ssh-sign
[commit]
gpgsign = true
template = ~/.gitmessage
[user]
signingkey = ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFLbhM2MVLj812MkWJnarSSiKywdAzc75pD6kedpX3Ab
email = jopcmelo@gmail.com
Expand Down
4 changes: 4 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ echo "Creating symlinks..."
link "$DOTFILES_DIR/fish/config.fish" "$HOME/.config/fish/config.fish"
link "$DOTFILES_DIR/git/config" "$HOME/.gitconfig"
link "$DOTFILES_DIR/git/ignore" "$HOME/.config/git/ignore"
link "$DOTFILES_DIR/.gitmessage" "$HOME/.gitmessage"
link "$DOTFILES_DIR/starship/starship.toml" "$HOME/.config/starship.toml"
link "$DOTFILES_DIR/aerospace/aerospace.toml" "$HOME/.config/aerospace/aerospace.toml"
link "$DOTFILES_DIR/claude/settings.json" "$HOME/.claude/settings.json"
Expand All @@ -39,6 +40,9 @@ link "$DOTFILES_DIR/wtf/config.yml" "$HOME/.config/wtf/config.yml"
link "$DOTFILES_DIR/try-rs/config.toml" "$HOME/Library/Application Support/try-rs/config.toml"

chmod +x "$DOTFILES_DIR/claude/file-suggestion.sh"
chmod +x "$DOTFILES_DIR/.githooks/commit-msg"

git -C "$DOTFILES_DIR" config core.hooksPath .githooks

echo "Importing app preferences..."
# BetterDisplay
Expand Down