File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,16 +8,17 @@ Some out-of-the-box hooks for [pre-commit](https://github.com/pre-commit/pre-com
88Add this to your ` .pre-commit-config.yaml `
99
1010 - repo: https://github.com/Kpler/kp-pre-commit-hooks.git
11- rev: v0.0.3 # Use the ref you want to point at
11+ rev: v0.0.7 # Use the ref you want to point at
1212 hooks:
1313 - id: check-branch-linearity
14- - id: check-commit-first-line-length
1514 - id: check-branch-name
15+ - id: no-ephemeral-links
16+ exclude: '\.md$'
1617
1718### Hooks available
1819
1920#### ` check-branch-linearity `
20- Simply check that your branch doesn't not contain any merge compare to master.
21+ Simply check that your branch doesn't not contain any merge compare to ` master ` or ` main ` branch .
2122It's a pre-push hook and will always run
2223
2324#### ` check-branch-name `
Original file line number Diff line number Diff line change 11#! /bin/sh
2- out=$( git log origin/master..HEAD --merges --oneline)
2+
3+ if [ " $( git branch --list main) " ]; then TARGET_BRANCH=" main" ; else TARGET_BRANCH=" master" ; fi
4+
5+ echo " Target branch: $TARGET_BRANCH "
6+ out=$( git log origin/${TARGET_BRANCH} ..HEAD --merges --oneline)
37
48exit_status=$?
59if [ -n " $out " ]
You can’t perform that action at this time.
0 commit comments