Bugzilla – Attachment 10053 Details for
Bug 6679
Fixing code so it passes basic Perl::Critic tests
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 6679: Fixing 24 perlcritic violations in misc/translator/TmplTokenizer.pm
Bug-6679-Fixing-24-perlcritic-violations-in-misctr.patch (text/plain), 4.64 KB, created by
Jared Camins-Esakov
on 2012-06-09 19:38:54 UTC
(
hide
)
Description:
Bug 6679: Fixing 24 perlcritic violations in misc/translator/TmplTokenizer.pm
Filename:
MIME Type:
Creator:
Jared Camins-Esakov
Created:
2012-06-09 19:38:54 UTC
Size:
4.64 KB
patch
obsolete
>From c0d6305a80f221693f5b164b1bcfdd6137cc7d61 Mon Sep 17 00:00:00 2001 >From: Mason James <mtj@kohaaloha.com> >Date: Thu, 24 May 2012 08:57:07 +1200 >Subject: [PATCH] Bug 6679: Fixing 24 perlcritic violations in misc/translator/TmplTokenizer.pm >Content-Type: text/plain; charset="UTF-8" > >Subroutine prototypes used at line XXX, column 1. See page 194 of PBP. >(Severity: 5) > >Note: Rebased on master 06/09/2012 by jcamins >--- > misc/translator/TmplTokenizer.pm | 54 +++++++++++++++++++------------------- > 1 files changed, 27 insertions(+), 27 deletions(-) > >diff --git a/misc/translator/TmplTokenizer.pm b/misc/translator/TmplTokenizer.pm >index 6129f8d..2cdff31 100644 >--- a/misc/translator/TmplTokenizer.pm >+++ b/misc/translator/TmplTokenizer.pm >@@ -48,21 +48,21 @@ use vars qw( $serial ); > > ############################################################################### > >-sub FATAL_P () {'fatal-p'} >-sub SYNTAXERROR_P () {'syntaxerror-p'} >+sub FATAL_P {'fatal-p'} >+sub SYNTAXERROR_P {'syntaxerror-p'} > >-sub FILENAME () {'input'} >-#sub HANDLE () {'handle'} >+sub FILENAME {'input'} >+#sub HANDLE {'handle'} > >-#sub READAHEAD () {'readahead'} >-sub LINENUM_START () {'lc_0'} >-sub LINENUM () {'lc'} >-sub CDATA_MODE_P () {'cdata-mode-p'} >-sub CDATA_CLOSE () {'cdata-close'} >-#sub PCDATA_MODE_P () {'pcdata-mode-p'} # additional submode for CDATA >-sub JS_MODE_P () {'js-mode-p'} # cdata-mode-p must also be true >+#sub READAHEAD {'readahead'} >+sub LINENUM_START {'lc_0'} >+sub LINENUM {'lc'} >+sub CDATA_MODE_P {'cdata-mode-p'} >+sub CDATA_CLOSE {'cdata-close'} >+#sub PCDATA_MODE_P {'pcdata-mode-p'} # additional submode for CDATA >+sub JS_MODE_P {'js-mode-p'} # cdata-mode-p must also be true > >-sub ALLOW_CFORMAT_P () {'allow-cformat-p'} >+sub ALLOW_CFORMAT_P {'allow-cformat-p'} > > sub new { > shift; >@@ -137,10 +137,10 @@ BEGIN { > # Perl quoting is really screwed up, but this common subexp is way too long > $js_EscapeSequence = q{\\\\(?:['"\\\\bfnrt]|[^0-7xu]|[0-3]?[0-7]{1,2}|x[\da-fA-F]{2}|u[\da-fA-F]{4})}; > } >-sub parenleft () { '(' } >-sub parenright () { ')' } >+sub parenleft { '(' } >+sub parenright { ')' } > >-sub _split_js ($) { >+sub _split_js { > my ($s0) = @_; > my @it = (); > while (length $s0) { >@@ -186,13 +186,13 @@ sub _split_js ($) { > return @it; > } > >-sub STATE_UNDERSCORE () { 1 } >-sub STATE_PARENLEFT () { 2 } >-sub STATE_STRING_LITERAL () { 3 } >+sub STATE_UNDERSCORE { 1 } >+sub STATE_PARENLEFT { 2 } >+sub STATE_STRING_LITERAL { 3 } > > # XXX This is a crazy hack. I don't want to write an ECMAScript parser. > # XXX A scanner is one thing; a parser another thing. >-sub _identify_js_translatables (@) { >+sub _identify_js_translatables { > my @input = @_; > my @output = (); > # We mark a JavaScript translatable string as in C, i.e., _("literal") >@@ -229,7 +229,7 @@ sub _identify_js_translatables (@) { > > ############################################################################### > >-sub string_canon ($) { >+sub string_canon ) { > my $s = shift; > # Fold all whitespace into single blanks > $s =~ s/\s+/ /g; >@@ -238,7 +238,7 @@ sub string_canon ($) { > } > > # safer version used internally, preserves new lines >-sub string_canon_safe ($) { >+sub string_canon_safe { > my $s = shift; > # fold tabs and spaces into single spaces > $s =~ s/[\ \t]+/ /gs; >@@ -361,7 +361,7 @@ sub next_token { > > # function taken from old version > # used by tmpl_process3 >-sub parametrize ($$$$) { >+sub parametrize { > my($fmt_0, $cformat_p, $t, $f) = @_; > my $it = ''; > if ($cformat_p) { >@@ -454,12 +454,12 @@ sub parametrize ($$$$) { > > # Other simple functions (These are not methods) > >-sub blank_p ($) { >+sub blank_p { > my($s) = @_; > return $s =~ /^(?:\s|\ $re_end_entity|$re_tmpl_var|$re_xsl)*$/osi; > } > >-sub trim ($) { >+sub trim { > my($s0) = @_; > my $l0 = length $s0; > my $s = $s0; >@@ -468,7 +468,7 @@ sub trim ($) { > return wantarray? (substr($s0, 0, $l1), $s, substr($s0, $l0 - $l2)): $s; > } > >-sub quote_po ($) { >+sub quote_po { > my($s) = @_; > # Locale::PO->quote is buggy, it doesn't quote newlines :-/ > $s =~ s/([\\"])/\\\1/gs; >@@ -477,7 +477,7 @@ sub quote_po ($) { > return "\"$s\""; > } > >-sub charset_canon ($) { >+sub charset_canon { > my($charset) = @_; > $charset = uc($charset); > $charset = "$1-$2" if $charset =~ /^(ISO|UTF)(\d.*)/i; >@@ -510,7 +510,7 @@ use vars qw( @latin1_utf8 ); > "\303\270", "\303\271", "\303\272", "\303\273", "\303\274", "\303\275", > "\303\276", "\303\277" ); > >-sub charset_convert ($$$) { >+sub charset_convert { > my($s, $charset_in, $charset_out) = @_; > if ($s !~ /[\200-\377]/s) { # FIXME: don't worry about iso2022 for now > ; >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 6679
:
4883
|
4884
|
4885
|
4886
|
4887
|
4888
|
5445
|
5446
|
5483
|
5487
|
6121
|
6122
|
6123
|
6139
|
6140
|
6141
|
6142
|
6143
|
6144
|
6270
|
6271
|
6663
|
6670
|
6675
|
6676
|
6677
|
6678
|
8542
|
8897
|
8898
|
8899
|
8950
|
8951
|
9746
|
9747
|
9748
|
9749
|
9750
|
10050
|
10051
|
10052
|
10053
|
10054
|
10075
|
10076
|
10077
|
10078
|
10079
|
10484
|
10485
|
10486
|
10487
|
10488
|
10489
|
10491
|
10492
|
10493
|
10494
|
10495
|
10496
|
10497
|
10499
|
10500
|
10501
|
10502
|
10503
|
10504
|
10505
|
10506
|
10507
|
10508
|
10509
|
10510
|
10512
|
10513
|
10514
|
10515
|
10517
|
10521
|
10522
|
10523
|
10524
|
10525
|
10526
|
10527
|
10935
|
10936
|
10938
|
10940
|
10944
|
10945
|
10946
|
10947
|
10948
|
10949
|
10950
|
10952
|
10953
|
10955
|
10957
|
10958
|
10959
|
10960
|
10961
|
10962
|
10963
|
10964
|
10965
|
10966
|
10967
|
10972
|
10976
|
10979
|
10980
|
10981
|
12224
|
12363
|
12490
|
12491
|
12492
|
34191
|
34192
|
34193
|
34194
|
34195
|
34196
|
34197
|
39100
|
39101
|
39102
|
39392
|
39393
|
39394
|
39395
|
39396
|
39397
|
39398
|
42770
|
47086
|
47087
|
47088
|
47089
|
47090
|
47178
|
47179
|
47180
|
47181
|
47205
|
47206
|
47207
|
47208