summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2022-10-18 11:30:56 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2022-10-18 11:37:12 +0900
commitab3b1b23811c44f56f3dff318b08a9112cba3582 (patch)
treebb4f80b3be2dd350e722fae39ca8da3b260cc85f /tool
parent329d5424a479bb08e75bd750c51a5382e382731c (diff)
sync_default_gems.rb: fix links to GitHub issues
- Substitute `GH-xxxx` which does not contain `#` too. - Split each substitutions.
Diffstat (limited to 'tool')
-rwxr-xr-xtool/sync_default_gems.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/tool/sync_default_gems.rb b/tool/sync_default_gems.rb
index d585f5f14a..a5f8c7fd09 100755
--- a/tool/sync_default_gems.rb
+++ b/tool/sync_default_gems.rb
@@ -422,13 +422,16 @@ def message_filter(repo, sha)
log = STDIN.read
log.delete!("\r")
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/"
- }.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]}"
- }.sub(/\s*(?=(?i:\nCo-authored-by:.*)*\Z)/) {
+ }
+ log.sub!(/\s*(?=(?i:\nCo-authored-by:.*)*\Z)/) {
"\n\n" "#{url}/commit/#{sha[0,10]}\n"
}
+ print "[#{repo}] ", log
end
# NOTE: This method is also used by ruby-commit-hook/bin/update-default-gem.sh