Skip to content

Commit

Permalink
dev: move commitlint to tools, keeping bin/ for user tools
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmichael committed Dec 11, 2021
1 parent 9ca6810 commit 16124eb
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion COMMITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 $*
Expand Down
6 changes: 3 additions & 3 deletions bin/commitlint → tools/commitlint
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 16124eb

Please sign in to comment.