mirror of
https://github.com/discourse/discourse.git
synced 2025-06-06 23:07:28 +08:00
Include accessibility commits when generating release notes (#11884)
This commit is contained in:
@ -10,6 +10,7 @@ task "release_note:generate", :from, :to do |t, args|
|
|||||||
ux_changes = Set.new
|
ux_changes = Set.new
|
||||||
sec_changes = Set.new
|
sec_changes = Set.new
|
||||||
perf_changes = Set.new
|
perf_changes = Set.new
|
||||||
|
a11y_changes = Set.new
|
||||||
|
|
||||||
`git log --pretty="tformat:%s" #{from}..#{to}`.each_line do |comment|
|
`git log --pretty="tformat:%s" #{from}..#{to}`.each_line do |comment|
|
||||||
next if comment =~ /^\s*Revert/
|
next if comment =~ /^\s*Revert/
|
||||||
@ -24,6 +25,8 @@ task "release_note:generate", :from, :to do |t, args|
|
|||||||
sec_changes << better(line)
|
sec_changes << better(line)
|
||||||
elsif line =~ /^PERF:/
|
elsif line =~ /^PERF:/
|
||||||
perf_changes << better(line)
|
perf_changes << better(line)
|
||||||
|
elsif line =~ /^A11Y:/
|
||||||
|
a11y_changes << better(line)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -33,6 +36,7 @@ task "release_note:generate", :from, :to do |t, args|
|
|||||||
print_changes("UX CHANGES", ux_changes)
|
print_changes("UX CHANGES", ux_changes)
|
||||||
print_changes("SECURITY CHANGES", sec_changes)
|
print_changes("SECURITY CHANGES", sec_changes)
|
||||||
print_changes("PERFORMANCE", perf_changes)
|
print_changes("PERFORMANCE", perf_changes)
|
||||||
|
print_changes("ACCESSIBILITY", a11y_changes)
|
||||||
end
|
end
|
||||||
|
|
||||||
def print_changes(heading, changes)
|
def print_changes(heading, changes)
|
||||||
@ -57,7 +61,7 @@ def better(line)
|
|||||||
end
|
end
|
||||||
|
|
||||||
def remove_prefix(line)
|
def remove_prefix(line)
|
||||||
line.gsub(/^(FIX|FEATURE|UX|SECURITY|PERF):/, "").strip
|
line.gsub(/^(FIX|FEATURE|UX|SECURITY|PERF|A11Y):/, "").strip
|
||||||
end
|
end
|
||||||
|
|
||||||
def escape_brackets(line)
|
def escape_brackets(line)
|
||||||
@ -73,7 +77,7 @@ end
|
|||||||
|
|
||||||
def split_comments(text)
|
def split_comments(text)
|
||||||
text = normalize_terms(text)
|
text = normalize_terms(text)
|
||||||
terms = ["FIX:", "FEATURE:", "UX:", "SECURITY:" , "PERF:"]
|
terms = ["FIX:", "FEATURE:", "UX:", "SECURITY:" , "PERF:" , "A11Y:"]
|
||||||
terms.each do |term|
|
terms.each do |term|
|
||||||
text = text.gsub(/(#{term})+/i, term)
|
text = text.gsub(/(#{term})+/i, term)
|
||||||
text = newlines_at_term(text, term)
|
text = newlines_at_term(text, term)
|
||||||
@ -87,6 +91,7 @@ def normalize_terms(text)
|
|||||||
text = text.gsub(/UX:/i, "UX:")
|
text = text.gsub(/UX:/i, "UX:")
|
||||||
text = text.gsub(/(SECURITY):/i, "SECURITY:")
|
text = text.gsub(/(SECURITY):/i, "SECURITY:")
|
||||||
text = text.gsub(/(PERF):/i, "PERF:")
|
text = text.gsub(/(PERF):/i, "PERF:")
|
||||||
|
text = text.gsub(/(A11Y):/i, "A11Y:")
|
||||||
end
|
end
|
||||||
|
|
||||||
def newlines_at_term(text, term)
|
def newlines_at_term(text, term)
|
||||||
|
Reference in New Issue
Block a user