Remove trailing whitespace when generating changelog entry
This commit is contained in:
parent
aa0a7aa3b5
commit
1c489296fd
2 changed files with 12 additions and 3 deletions
|
@ -84,12 +84,15 @@ class ChangelogEntry
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
def contents
|
def contents
|
||||||
YAML.dump(
|
yaml_content = YAML.dump(
|
||||||
'title' => title,
|
'title' => title,
|
||||||
'merge_request' => options.merge_request,
|
'merge_request' => options.merge_request,
|
||||||
'author' => options.author
|
'author' => options.author
|
||||||
)
|
)
|
||||||
|
remove_trailing_whitespace(yaml_content)
|
||||||
end
|
end
|
||||||
|
|
||||||
def write
|
def write
|
||||||
|
@ -101,8 +104,6 @@ class ChangelogEntry
|
||||||
exec("git commit --amend")
|
exec("git commit --amend")
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def fail_with(message)
|
def fail_with(message)
|
||||||
$stderr.puts "\e[31merror\e[0m #{message}"
|
$stderr.puts "\e[31merror\e[0m #{message}"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -160,6 +161,10 @@ class ChangelogEntry
|
||||||
def branch_name
|
def branch_name
|
||||||
@branch_name ||= %x{git symbolic-ref --short HEAD}.strip
|
@branch_name ||= %x{git symbolic-ref --short HEAD}.strip
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def remove_trailing_whitespace(yaml_content)
|
||||||
|
yaml_content.gsub(/ +$/, '')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if $0 == __FILE__
|
if $0 == __FILE__
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
title: Remove trailing whitespace when generating changelog entry
|
||||||
|
merge_request: 7948
|
||||||
|
author:
|
Loading…
Reference in a new issue