Skip to content
Snippets Groups Projects
Commit 1c489296 authored by Adam Niedzielski's avatar Adam Niedzielski
Browse files

Remove trailing whitespace when generating changelog entry

parent aa0a7aa3
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -84,12 +84,15 @@ class ChangelogEntry
end
end
 
private
def contents
YAML.dump(
yaml_content = YAML.dump(
'title' => title,
'merge_request' => options.merge_request,
'author' => options.author
)
remove_trailing_whitespace(yaml_content)
end
 
def write
Loading
Loading
@@ -101,8 +104,6 @@ class ChangelogEntry
exec("git commit --amend")
end
 
private
def fail_with(message)
$stderr.puts "\e[31merror\e[0m #{message}"
exit 1
Loading
Loading
@@ -160,6 +161,10 @@ class ChangelogEntry
def branch_name
@branch_name ||= %x{git symbolic-ref --short HEAD}.strip
end
def remove_trailing_whitespace(yaml_content)
yaml_content.gsub(/ +$/, '')
end
end
 
if $0 == __FILE__
Loading
Loading
---
title: Remove trailing whitespace when generating changelog entry
merge_request: 7948
author:
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment