[Rt-commit] rt branch, 3.9-trunk, updated. rt-3.9.7-944-gb6f6355

Shawn Moore sartak at bestpractical.com
Fri Dec 17 20:19:40 EST 2010


The branch, 3.9-trunk has been updated
       via  b6f6355c9f848ddadb114caa21313888d3281ee1 (commit)
      from  07865b8a258f3ec3b0ce9b04a9fb648a2da0648b (commit)

Summary of changes:
 devel/extract-message-catalog |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

- Log -----------------------------------------------------------------
commit b6f6355c9f848ddadb114caa21313888d3281ee1
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Fri Dec 17 20:19:25 2010 -0500

    Warn about extra whitespace in extract-message-catalog

diff --git a/devel/extract-message-catalog b/devel/extract-message-catalog
index 9d6eade..ded346a 100755
--- a/devel/extract-message-catalog
+++ b/devel/extract-message-catalog
@@ -99,6 +99,19 @@ foreach my $dict (@ARGV) {
     update($lang, $dict);
 }
 
+# warn about extra whitespace (at the very end so it'll be harder to miss)
+foreach my $str ( sort keys %{$FILECAT} ) {
+    my $entry = $FILECAT->{$str};
+    my $entry_count = @$entry;
+
+    if ($str =~ /^\s/m || $str =~ /\s$/m || $str =~ /\\n$/m) {
+        # doesn't exist in the current codebase, ignore for now
+        next if $entry_count == 0;
+
+        my ($filename, $line) = @{ $entry->[0] };
+        warn "Extraneous whitespace in '$str' at $filename line $line" . ($entry_count > 1 ? " (and ".($entry_count-1)." other places)" : "") . "\n";
+    }
+}
 
 
 sub extract_strings_from_code {

-----------------------------------------------------------------------


More information about the Rt-commit mailing list