mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 16:42:46 +08:00
Include accessibility commits when generating release notes (#11884)
This commit is contained in:
parent
c4dc610498
commit
b70e0d88f7
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user