Replace "Fixes"/"Fixed" in commit logs as well as vcs.rb [ci skip]

Use the same regexp to replace "(#NNNN)" and "GH-NNNN" style
references in vcs.rb, too.
This commit is contained in:
Nobuyoshi Nakada 2022-09-14 11:18:58 +09:00
Родитель f863bc505c
Коммит c28a4e0340
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 7CD2805BFA3770C6
2 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -659,7 +659,7 @@ class VCS
if %r[^ +(https://github\.com/[^/]+/[^/]+/)commit/\h+\n(?=(?: +\n(?i: +Co-authored-by: .*\n)+)?(?:\n|\Z))] =~ s
issue = "#{$1}pull/"
s.gsub!(/\b[Ff]ix(?:e[sd])? \K#(?=\d+)/) {issue}
s.gsub!(/\b(?:(?i:fix(?:e[sd])?) +|GH-)\K#(?=\d+\b)|\(\K#(?=\d+\))/) {issue}
end
s.gsub!(/ +\n/, "\n")

Просмотреть файл

@ -397,7 +397,7 @@ def message_filter(repo, sha)
log = STDIN.read
log.delete!("\r")
url = "https://github.com/#{repo}"
print "[#{repo}] ", log.gsub(/\b(?i:fix) +\K#(?=\d+\b)|\(\K#(?=\d+\))|\bGH-(?=\d+\b)/) {
print "[#{repo}] ", log.gsub(/\b(?:(?i:fix(?:e[sd])?) +|GH-)\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]}"