From 16124eba142ab4f5f87dd750f3fb3fe2542e92ff Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Fri, 10 Dec 2021 16:52:19 -1000 Subject: [PATCH] dev: move commitlint to tools, keeping bin/ for user tools --- .github/workflows/mac.yml | 4 ++-- .github/workflows/pull.yml | 6 +++--- .github/workflows/push.yml | 6 +++--- .github/workflows/windows.yml | 4 ++-- COMMITS.md | 2 +- Makefile | 4 ++-- {bin => tools}/commitlint | 6 +++--- 7 files changed, 16 insertions(+), 16 deletions(-) rename {bin => tools}/commitlint (95%) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 8f71ae9f0..34b468c4d 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -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 diff --git a/.github/workflows/pull.yml b/.github/workflows/pull.yml index 7c850c47f..c60dc7875 100644 --- a/.github/workflows/pull.yml +++ b/.github/workflows/pull.yml @@ -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 diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 775bd79ef..68edc6273 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -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 diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index b8cfec084..8c3dfa9aa 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -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 diff --git a/COMMITS.md b/COMMITS.md index 7a7efcd20..cdb4986e8 100644 --- a/COMMITS.md +++ b/COMMITS.md @@ -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. diff --git a/Makefile b/Makefile index a6c3302e8..439725c48 100644 --- a/Makefile +++ b/Makefile @@ -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 $* diff --git a/bin/commitlint b/tools/commitlint similarity index 95% rename from bin/commitlint rename to tools/commitlint index 70dc8e38b..1ea9f951c 100755 --- a/bin/commitlint +++ b/tools/commitlint @@ -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