Skip to content

Instantly share code, notes, and snippets.

View kurtke1990's full-sized avatar

Kurt kurtke1990

  • Taoyuan, Taiwan
View GitHub Profile
@kurtke1990
kurtke1990 / pre-push
Last active January 5, 2024 02:19
semantic commit message hook
#!/bin/bash
current_branch=$(git rev-parse --abbrev-ref HEAD)
base_branch=$(git show-branch -a | grep '\*' | grep -v "$(git rev-parse --abbrev-ref HEAD)" | head -n1 | sed 's/[\^~].*/\]/' | sed 's/.*\[\(.*\)\].*/\1/')
msg_regex="(^(feat|fix|chore|docs|style|refactor|perf|test|build|ci)(\(([^)]*)\))?: (.+))|(^Merge (branch|pull request) .+)|(^Revert .+)"
commit_messages=$(git log --pretty="%s" "$base_branch..$current_branch")
IFS=$'\n'
for commit_msg in $commit_messages; do
@kurtke1990
kurtke1990 / pytest.ini
Created August 17, 2023 15:35
Basic pytest config
[pytest]
pythonpath = .
addopts = -ra -s -v -p no:cacheprovider
testpaths = .