dev: move commitlint to tools, keeping bin/ for user tools

This commit is contained in:
Simon Michael 2021-12-10 16:52:19 -10:00
parent 9ca681097a
commit 16124eba14
7 changed files with 16 additions and 16 deletions

View File

@ -48,9 +48,9 @@ jobs:
run: |
RANGE=${BEFORE:-origin/master}..${GITHUB_HEAD_REF:+origin/$GITHUB_HEAD_REF}
git rev-list --quiet $RANGE \
&& bin/commitlint $RANGE \
&& tools/commitlint $RANGE \
|| ( echo "could not identify commits, not checking them" )
# || ( echo "could not identify commits, checking last $NUM instead:"; bin/commitlint -$NUM )
# || ( echo "could not identify commits, checking last $NUM instead:"; tools/commitlint -$NUM )
- name: Skip remaining CI steps if latest commit message begins with ;
shell: bash

View File

@ -75,7 +75,7 @@ jobs:
# echo "$GITHUB_HEAD_REF"
# echo "$GITHUB_BASE_REF"
# git log "$GITHUB_BASE_REF"..
# bin/commitlint "$GITHUB_BASE_REF"..
# tools/commitlint "$GITHUB_BASE_REF"..
# keep synced in all workflows which do this
- name: Check commit messages
@ -91,9 +91,9 @@ jobs:
run: |
RANGE=${BEFORE:-origin/master}..${GITHUB_HEAD_REF:+origin/$GITHUB_HEAD_REF}
git rev-list --quiet $RANGE \
&& bin/commitlint $RANGE \
&& tools/commitlint $RANGE \
|| ( echo "could not identify commits, not checking them" )
# || ( echo "could not identify commits, checking last $NUM instead:"; bin/commitlint -$NUM )
# || ( echo "could not identify commits, checking last $NUM instead:"; tools/commitlint -$NUM )
- name: Skip remaining CI steps if latest commit message begins with ;
shell: bash

View File

@ -66,7 +66,7 @@ jobs:
# echo "$GITHUB_HEAD_REF"
# echo "$GITHUB_BASE_REF"
# git log "$GITHUB_BASE_REF"..
# bin/commitlint "$GITHUB_BASE_REF"..
# tools/commitlint "$GITHUB_BASE_REF"..
# keep synced in all workflows which do this
- name: Check commit messages
@ -82,9 +82,9 @@ jobs:
run: |
RANGE=${BEFORE:-origin/master}..${GITHUB_HEAD_REF:+origin/$GITHUB_HEAD_REF}
git rev-list --quiet $RANGE \
&& bin/commitlint $RANGE \
&& tools/commitlint $RANGE \
|| ( echo "could not identify commits, not checking them" )
# || ( echo "could not identify commits, checking last $NUM instead:"; bin/commitlint -$NUM )
# || ( echo "could not identify commits, checking last $NUM instead:"; tools/commitlint -$NUM )
- name: Skip remaining CI steps if latest commit message begins with ;
shell: bash

View File

@ -41,9 +41,9 @@ jobs:
run: |
RANGE=${BEFORE:-origin/master}..${GITHUB_HEAD_REF:+origin/$GITHUB_HEAD_REF}
git rev-list --quiet $RANGE \
&& bin/commitlint $RANGE \
&& tools/commitlint $RANGE \
|| ( echo "could not identify commits, not checking them" )
# || ( echo "could not identify commits, checking last $NUM instead:"; bin/commitlint -$NUM )
# || ( echo "could not identify commits, checking last $NUM instead:"; tools/commitlint -$NUM )
- name: Skip remaining CI steps if latest commit message begins with ;
shell: bash

View File

@ -21,7 +21,7 @@ Here they are in brief:
## When committing / pushing / merging:
- run `bin/commitlint` before push, to check recent commits
- run `tools/commitlintnt` before push, to check recent commits
- or, run it automatically before each commit (`make installcommithook` to configure your local repo)
- it also runs in CI on github for pull requests, etc.

View File

@ -1055,8 +1055,8 @@ list-commits: $(call def-help,list-commits, list all commits chronologically and
###############################################################################
$(call def-help-subheading,MISCELLANEOUS:)
installcommithook: $(call def-help,installcommithook, symlink bin/commitlint as .git/hooks/commit-msg)
ln -s ../../bin/commitlint .git/hooks/commit-msg
installcommithook: $(call def-help,installcommithook, symlink tools/commitlint as .git/hooks/commit-msg)
ln -s ../../tools/commitlint .git/hooks/commit-msg
watch-%: $(call def-help,watch-RULE, run make RULE repeatedly when any committed file changes)
@git ls-files | entr -r make $*

View File

@ -127,9 +127,9 @@ More context: https://hledger.org/CONTRIBUTING.html#commit-messages
You can set up this script to check your commit messages locally:
1. before committing:
a. safer but must redo: cp bin/commitlint .git/hooks/commit-msg
b. more convenient: ln -s ../../bin/commitlint .git/hooks/commit-msg
2. before pushing: bin/commitlint && git push
a. safer but must redo: cp tools/commitlint .git/hooks/commit-msg
b. more convenient: ln -s ../../tools/commitlint .git/hooks/commit-msg
2. before pushing: tools/commitlint && git push
---------------------------------------------------------------------------
EOF