dev: move commitlint to tools, keeping bin/ for user tools
This commit is contained in:
		
							parent
							
								
									9ca681097a
								
							
						
					
					
						commit
						16124eba14
					
				
							
								
								
									
										4
									
								
								.github/workflows/mac.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								.github/workflows/mac.yml
									
									
									
									
										vendored
									
									
								
							| @ -48,9 +48,9 @@ jobs: | |||||||
|       run: | |       run: | | ||||||
|         RANGE=${BEFORE:-origin/master}..${GITHUB_HEAD_REF:+origin/$GITHUB_HEAD_REF} |         RANGE=${BEFORE:-origin/master}..${GITHUB_HEAD_REF:+origin/$GITHUB_HEAD_REF} | ||||||
|         git rev-list --quiet $RANGE \ |         git rev-list --quiet $RANGE \ | ||||||
|           && bin/commitlint  $RANGE \ |           && tools/commitlint  $RANGE \ | ||||||
|           || ( echo "could not identify commits, not checking them" ) |           || ( 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 ; |     - name: Skip remaining CI steps if latest commit message begins with ; | ||||||
|       shell: bash |       shell: bash | ||||||
|  | |||||||
							
								
								
									
										6
									
								
								.github/workflows/pull.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								.github/workflows/pull.yml
									
									
									
									
										vendored
									
									
								
							| @ -75,7 +75,7 @@ jobs: | |||||||
|     #     echo "$GITHUB_HEAD_REF" |     #     echo "$GITHUB_HEAD_REF" | ||||||
|     #     echo "$GITHUB_BASE_REF" |     #     echo "$GITHUB_BASE_REF" | ||||||
|     #     git log "$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 |     # keep synced in all workflows which do this | ||||||
|     - name: Check commit messages |     - name: Check commit messages | ||||||
| @ -91,9 +91,9 @@ jobs: | |||||||
|       run: | |       run: | | ||||||
|         RANGE=${BEFORE:-origin/master}..${GITHUB_HEAD_REF:+origin/$GITHUB_HEAD_REF} |         RANGE=${BEFORE:-origin/master}..${GITHUB_HEAD_REF:+origin/$GITHUB_HEAD_REF} | ||||||
|         git rev-list --quiet $RANGE \ |         git rev-list --quiet $RANGE \ | ||||||
|           && bin/commitlint  $RANGE \ |           && tools/commitlint  $RANGE \ | ||||||
|           || ( echo "could not identify commits, not checking them" ) |           || ( 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 ; |     - name: Skip remaining CI steps if latest commit message begins with ; | ||||||
|       shell: bash |       shell: bash | ||||||
|  | |||||||
							
								
								
									
										6
									
								
								.github/workflows/push.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								.github/workflows/push.yml
									
									
									
									
										vendored
									
									
								
							| @ -66,7 +66,7 @@ jobs: | |||||||
|     #     echo "$GITHUB_HEAD_REF" |     #     echo "$GITHUB_HEAD_REF" | ||||||
|     #     echo "$GITHUB_BASE_REF" |     #     echo "$GITHUB_BASE_REF" | ||||||
|     #     git log "$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 |     # keep synced in all workflows which do this | ||||||
|     - name: Check commit messages |     - name: Check commit messages | ||||||
| @ -82,9 +82,9 @@ jobs: | |||||||
|       run: | |       run: | | ||||||
|         RANGE=${BEFORE:-origin/master}..${GITHUB_HEAD_REF:+origin/$GITHUB_HEAD_REF} |         RANGE=${BEFORE:-origin/master}..${GITHUB_HEAD_REF:+origin/$GITHUB_HEAD_REF} | ||||||
|         git rev-list --quiet $RANGE \ |         git rev-list --quiet $RANGE \ | ||||||
|           && bin/commitlint  $RANGE \ |           && tools/commitlint  $RANGE \ | ||||||
|           || ( echo "could not identify commits, not checking them" ) |           || ( 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 ; |     - name: Skip remaining CI steps if latest commit message begins with ; | ||||||
|       shell: bash |       shell: bash | ||||||
|  | |||||||
							
								
								
									
										4
									
								
								.github/workflows/windows.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								.github/workflows/windows.yml
									
									
									
									
										vendored
									
									
								
							| @ -41,9 +41,9 @@ jobs: | |||||||
|       run: | |       run: | | ||||||
|         RANGE=${BEFORE:-origin/master}..${GITHUB_HEAD_REF:+origin/$GITHUB_HEAD_REF} |         RANGE=${BEFORE:-origin/master}..${GITHUB_HEAD_REF:+origin/$GITHUB_HEAD_REF} | ||||||
|         git rev-list --quiet $RANGE \ |         git rev-list --quiet $RANGE \ | ||||||
|           && bin/commitlint  $RANGE \ |           && tools/commitlint  $RANGE \ | ||||||
|           || ( echo "could not identify commits, not checking them" ) |           || ( 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 ; |     - name: Skip remaining CI steps if latest commit message begins with ; | ||||||
|       shell: bash |       shell: bash | ||||||
|  | |||||||
| @ -21,7 +21,7 @@ Here they are in brief: | |||||||
| 
 | 
 | ||||||
| ## When committing / pushing / merging: | ## 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) | - 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. | - it also runs in CI on github for pull requests, etc. | ||||||
| 
 | 
 | ||||||
|  | |||||||
							
								
								
									
										4
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								Makefile
									
									
									
									
									
								
							| @ -1055,8 +1055,8 @@ list-commits: $(call def-help,list-commits, list all commits chronologically and | |||||||
| ###############################################################################
 | ###############################################################################
 | ||||||
| $(call def-help-subheading,MISCELLANEOUS:) | $(call def-help-subheading,MISCELLANEOUS:) | ||||||
| 
 | 
 | ||||||
| installcommithook: $(call def-help,installcommithook, symlink bin/commitlint as .git/hooks/commit-msg) | installcommithook: $(call def-help,installcommithook, symlink tools/commitlint as .git/hooks/commit-msg) | ||||||
| 	ln -s ../../bin/commitlint .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) | watch-%: $(call def-help,watch-RULE, run make RULE repeatedly when any committed file changes) | ||||||
| 	 @git ls-files | entr -r make $* | 	 @git ls-files | entr -r make $* | ||||||
|  | |||||||
| @ -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: | You can set up this script to check your commit messages locally: | ||||||
| 1. before committing: | 1. before committing: | ||||||
|    a. safer but must redo:  cp bin/commitlint .git/hooks/commit-msg |    a. safer but must redo:  cp tools/commitlint .git/hooks/commit-msg | ||||||
|    b. more convenient:      ln -s ../../bin/commitlint .git/hooks/commit-msg |    b. more convenient:      ln -s ../../tools/commitlint .git/hooks/commit-msg | ||||||
| 2. before pushing:          bin/commitlint && git push | 2. before pushing:          tools/commitlint && git push | ||||||
| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | ||||||
| EOF | EOF | ||||||
| 
 | 
 | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user