ci: commitlint: ignore boring commits: github merge commit (#1606)
This commit is contained in:
		
							parent
							
								
									ce526305bf
								
							
						
					
					
						commit
						4d04da94fb
					
				| @ -53,19 +53,25 @@ function checkmsg() | |||||||
|     SUMMARY=$(echo "$MSG" | head -1) |     SUMMARY=$(echo "$MSG" | head -1) | ||||||
|     FMT="%s%-60s  %b${NRM}\n" |     FMT="%s%-60s  %b${NRM}\n" | ||||||
| 
 | 
 | ||||||
|  |     # Is this some boring commit, eg a hard-to avoid github merge commit ? | ||||||
|  |     # Ignore those. | ||||||
|  |     if echo "$SUMMARY" | grep -qE '^Merge \w{40} into \w{40}' | ||||||
|  |     then  | ||||||
|  |         # shellcheck disable=SC2059 | ||||||
|  |         printf "$FMT" "$HASH" "$SUMMARY" "[ignored]" | ||||||
|     # Does the summary follow convention ? |     # Does the summary follow convention ? | ||||||
|     # [;]type[!]: [topic: [subtopic: ...]] subject |     # [;]type[!]: [topic: [subtopic: ...]] subject | ||||||
|     # |  | ||||||
|     # spaces after ; and ! and : are optional (also before, but that should be discouraged) |     # spaces after ; and ! and : are optional (also before, but that should be discouraged) | ||||||
|     # the type prefix is required and must be all word characters |     # the type prefix is required and must be all word characters | ||||||
|     # there can be zero or more topic prefixes of increasing depth |     # there can be zero or more topic prefixes of increasing depth | ||||||
|     # a topic prefix must begin with a word character, can contain spaces/slashes/commas |     # a topic prefix must begin with a word character, can contain spaces/slashes/commas | ||||||
|     # (so potentially multiple topic labels, eg "imp: bs, cf, is: cli/doc: blah blah") |     # (so potentially multiple topic labels, eg "imp: bs, cf, is: cli/doc: blah blah") | ||||||
|     if ! echo "$SUMMARY" | grep -qE '^( *; *)?\w+( *!)? *: *(\w[\w,/ ]* *: *)*' |     elif ! echo "$SUMMARY" | grep -qE '^( *; *)?\w+( *!)? *: *(\w[\w,/ ]* *: *)*' | ||||||
|     then |     then | ||||||
|         # shellcheck disable=SC2059 |         # shellcheck disable=SC2059 | ||||||
|         printf "$FMT" "$HASH" "$SUMMARY" "${RED}[FAIL]" |         printf "$FMT" "$HASH" "$SUMMARY" "${RED}[FAIL]" | ||||||
|         STATUS=1 |         STATUS=1 | ||||||
|  |     # Looks like a good commit. | ||||||
|     else |     else | ||||||
|         # shellcheck disable=SC2059 |         # shellcheck disable=SC2059 | ||||||
|         printf "$FMT" "$HASH" "$SUMMARY" "${GRN}[ok]" |         printf "$FMT" "$HASH" "$SUMMARY" "${GRN}[ok]" | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user