sync_default_gems.rb: fix links to GitHub issues
- Substitute `GH-xxxx` which does not contain `#` too. - Split each substitutions.
This commit is contained in:
parent
329d5424a4
commit
ab3b1b2381
@ -422,13 +422,16 @@ def message_filter(repo, sha)
|
|||||||
log = STDIN.read
|
log = STDIN.read
|
||||||
log.delete!("\r")
|
log.delete!("\r")
|
||||||
url = "https://github.com/#{repo}"
|
url = "https://github.com/#{repo}"
|
||||||
print "[#{repo}] ", log.gsub(/\b(?:(?i:fix(?:e[sd])?) +|GH-)\K#(?=\d+\b)|\(\K#(?=\d+\))/) {
|
log.gsub!(/\b(?:(?i:fix(?:e[sd])?) +)\K#(?=\d+\b)|\bGH-#?(?=\d+\b)|\(\K#(?=\d+\))/) {
|
||||||
"#{url}/pull/"
|
"#{url}/pull/"
|
||||||
}.gsub(%r{(?<![-\[\](){}\w@/])(?:(\w+(?:-\w+)*/\w+(?:-\w+)*)@)?(\h{10,40})\b}) {|c|
|
}
|
||||||
|
log.gsub!(%r{(?<![-\[\](){}\w@/])(?:(\w+(?:-\w+)*/\w+(?:-\w+)*)@)?(\h{10,40})\b}) {|c|
|
||||||
"https://github.com/#{$1 || repo}/commit/#{$2[0,12]}"
|
"https://github.com/#{$1 || repo}/commit/#{$2[0,12]}"
|
||||||
}.sub(/\s*(?=(?i:\nCo-authored-by:.*)*\Z)/) {
|
}
|
||||||
|
log.sub!(/\s*(?=(?i:\nCo-authored-by:.*)*\Z)/) {
|
||||||
"\n\n" "#{url}/commit/#{sha[0,10]}\n"
|
"\n\n" "#{url}/commit/#{sha[0,10]}\n"
|
||||||
}
|
}
|
||||||
|
print "[#{repo}] ", log
|
||||||
end
|
end
|
||||||
|
|
||||||
# NOTE: This method is also used by ruby-commit-hook/bin/update-default-gem.sh
|
# NOTE: This method is also used by ruby-commit-hook/bin/update-default-gem.sh
|
||||||
|
Loading…
x
Reference in New Issue
Block a user