diff options
author | Adam Niedzielski <adamsunday@gmail.com> | 2016-12-09 12:25:29 +0100 |
---|---|---|
committer | Adam Niedzielski <adamsunday@gmail.com> | 2016-12-09 12:25:29 +0100 |
commit | 1c489296fd43fa45621b2ab6e6982327fb864b56 (patch) | |
tree | 050e4c2167a7b9245aebce0ddb62b96d2c5f75ea /bin | |
parent | aa0a7aa3b5ba59b772f4d0c0bd061d278295b01f (diff) | |
download | gitlab-ce-1c489296fd43fa45621b2ab6e6982327fb864b56.tar.gz |
Remove trailing whitespace when generating changelog entrynuke-ugly-spaces-in-changelog-generator
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/changelog | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/bin/changelog b/bin/changelog index e07b1ad237a..4c894f8ff5b 100755 --- a/bin/changelog +++ b/bin/changelog @@ -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 @@ -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 @@ -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__ |