From b70e0d88f79e1ff316ed1ffb88674d9ddd491538 Mon Sep 17 00:00:00 2001 From: Joshua Rosenfeld Date: Thu, 28 Jan 2021 12:58:04 -0500 Subject: [PATCH] Include accessibility commits when generating release notes (#11884) --- lib/tasks/release_note.rake | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/tasks/release_note.rake b/lib/tasks/release_note.rake index 12d24a474e4..2c318b838a0 100644 --- a/lib/tasks/release_note.rake +++ b/lib/tasks/release_note.rake @@ -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)