1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

sync_default_gems.rb: GitHub links at word boundary only [ci skip]

This commit is contained in:
Nobuyoshi Nakada 2021-12-24 14:12:53 +09:00
parent 3a59abab08
commit 097c4a2adf
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -381,8 +381,8 @@ def message_filter(repo, sha)
log = STDIN.read
log.delete!("\r")
url = "https://github.com/#{repo}"
print "[#{repo}] ", log.gsub(/fix +#\d+|\(#\d+\)/i) {
$&.sub(/#/) {"#{url}/pull/"}
print "[#{repo}] ", log.gsub(/\b(?i:fix) +\K#(?=\d+\b)|\(\K#(?=\d+\))/) {
"#{url}/pull/"
}.gsub(%r{(?<![-\[\](){}\w@/])(?:(\w+(?:-\w+)*/\w+(?:-\w+)*)@)?(\h{10,40})\b}) {|c|
"https://github.com/#{$1 || repo}/commit/#{$2[0,12]}"
}.sub(/\s*(?=(?i:\nCo-authored-by:.*)*\Z)/) {