diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-12-24 14:12:53 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-12-24 14:27:03 +0900 |
commit | 097c4a2adf6ed640bd5c89653e591a674acd4c6e (patch) | |
tree | 35159c943471bf38d6cf7d23b9eb62761486226b /tool/sync_default_gems.rb | |
parent | 3a59abab0875ef734311a6f74de10dc480445e4a (diff) |
sync_default_gems.rb: GitHub links at word boundary only [ci skip]
Diffstat (limited to 'tool/sync_default_gems.rb')
-rwxr-xr-x | tool/sync_default_gems.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tool/sync_default_gems.rb b/tool/sync_default_gems.rb index eb186ef280..d10e95902b 100755 --- a/tool/sync_default_gems.rb +++ b/tool/sync_default_gems.rb @@ -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)/) { |