Include accessibility commits when generating release notes (#11884)

This commit is contained in:
Joshua Rosenfeld 2021-01-28 12:58:04 -05:00 committed by GitHub
parent c4dc610498
commit b70e0d88f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,6 +10,7 @@ task "release_note:generate", :from, :to do |t, args|
ux_changes = Set.new
sec_changes = Set.new
perf_changes = Set.new
a11y_changes = Set.new
`git log --pretty="tformat:%s" #{from}..#{to}`.each_line do |comment|
next if comment =~ /^\s*Revert/
@ -24,6 +25,8 @@ task "release_note:generate", :from, :to do |t, args|
sec_changes << better(line)
elsif line =~ /^PERF:/
perf_changes << better(line)
elsif line =~ /^A11Y:/
a11y_changes << better(line)
end
end
end
@ -33,6 +36,7 @@ task "release_note:generate", :from, :to do |t, args|
print_changes("UX CHANGES", ux_changes)
print_changes("SECURITY CHANGES", sec_changes)
print_changes("PERFORMANCE", perf_changes)
print_changes("ACCESSIBILITY", a11y_changes)
end
def print_changes(heading, changes)
@ -57,7 +61,7 @@ def better(line)
end
def remove_prefix(line)
line.gsub(/^(FIX|FEATURE|UX|SECURITY|PERF):/, "").strip
line.gsub(/^(FIX|FEATURE|UX|SECURITY|PERF|A11Y):/, "").strip
end
def escape_brackets(line)
@ -73,7 +77,7 @@ end
def split_comments(text)
text = normalize_terms(text)
terms = ["FIX:", "FEATURE:", "UX:", "SECURITY:" , "PERF:"]
terms = ["FIX:", "FEATURE:", "UX:", "SECURITY:" , "PERF:" , "A11Y:"]
terms.each do |term|
text = text.gsub(/(#{term})+/i, term)
text = newlines_at_term(text, term)
@ -87,6 +91,7 @@ def normalize_terms(text)
text = text.gsub(/UX:/i, "UX:")
text = text.gsub(/(SECURITY):/i, "SECURITY:")
text = text.gsub(/(PERF):/i, "PERF:")
text = text.gsub(/(A11Y):/i, "A11Y:")
end
def newlines_at_term(text, term)