From: Daniel Böhmer Date: Tue, 27 Nov 2018 09:51:03 +0000 (+0100) Subject: Fix trailing whitespace in header comments X-Git-Tag: v1.61~7 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=22fc086af6e3fcbc9c29f9420b2ce719cb84684b;hp=4a06a63f38d6ff6436e9b18bbec405faa7d092a5;p=dbsrgits%2FSQL-Translator.git Fix trailing whitespace in header comments --- diff --git a/lib/SQL/Translator/Utils.pm b/lib/SQL/Translator/Utils.pm index ed3fabc..3f256aa 100644 --- a/lib/SQL/Translator/Utils.pm +++ b/lib/SQL/Translator/Utils.pm @@ -9,7 +9,7 @@ use Try::Tiny; use Carp qw(carp croak); our $VERSION = '1.60'; -our $DEFAULT_COMMENT = '-- '; +our $DEFAULT_COMMENT = '--'; use base qw(Exporter); our @EXPORT_OK = qw( @@ -111,14 +111,14 @@ sub header_comment { my $header_comment =<<"HEADER_COMMENT"; ${comment_char} -${comment_char}Created by $producer -${comment_char}Created on $now +${comment_char} Created by $producer +${comment_char} Created on $now ${comment_char} HEADER_COMMENT # Any additional stuff passed in for my $additional_comment (@_) { - $header_comment .= "${comment_char}${additional_comment}\n"; + $header_comment .= "${comment_char} ${additional_comment}\n"; } return $header_comment; @@ -547,7 +547,7 @@ Will give three different results; specifically: =head2 $DEFAULT_COMMENT -This is the default comment string, '-- ' by default. Useful for +This is the default comment string, '--' by default. Useful for C. =head2 parse_mysql_version diff --git a/t/12header_comment.t b/t/12header_comment.t index 17c0911..84f5858 100644 --- a/t/12header_comment.t +++ b/t/12header_comment.t @@ -8,7 +8,7 @@ use SQL::Translator::Utils qw($DEFAULT_COMMENT header_comment); # Superfluous test, but that's ok use_ok("SQL::Translator::Utils"); -is($DEFAULT_COMMENT, '-- ', 'default comment'); +is($DEFAULT_COMMENT, '--', 'default comment'); like(header_comment("foo"), qr/[-][-] Created by foo/, "Created by..."); my $comm = header_comment("My::Producer",