Changeset 1588

Show
Ignore:
Timestamp:
08/24/06 19:14:33
Author:
miyagawa
Message:
  • Added Test::Perl::Critic test and t/perlcriticrc policy file
  • Fixed 2 args open() to comfort with PBP
  • Added ## no critic to express "I know what I'm doing"
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/plagger/lib/Plagger.pm

    r1585 r1588  
    9191    } 
    9292 
    93     open my $fh, $self->{config_path} or $self->error("$self->{config_path}: $!"); 
     93    open my $fh, '<', $self->{config_path} or $self->error("$self->{config_path}: $!"); 
    9494    my $data = join '', <$fh>; 
    9595    close $fh; 
     
    187187    my($self, $file) = @_; 
    188188 
    189     open my $fh, $file or die "$file: $!"; 
     189    open my $fh, '<', $file or die "$file: $!"; 
    190190    while (<$fh>) { 
    191191        /^package (Plagger::Plugin::.*?);/ and return $1; 
  • trunk/plagger/lib/Plagger/Plugin/Filter/EntryFullText.pm

    r1537 r1588  
    5757    my($self, $file, $base) = @_; 
    5858 
    59     open my $fh, $file or Plagger->context->error("$file: $!"); 
     59    open my $fh, '<', $file or Plagger->context->error("$file: $!"); 
    6060    (my $pkg = $base) =~ s/\.pl$//; 
    6161    my $plugin_class = "Plagger::Plugin::Filter::EntryFullText::Site::$pkg"; 
  • trunk/plagger/lib/Plagger/Plugin/Filter/FindEnclosures.pm

    r936 r1588  
    5353    my($self, $file, $base) = @_; 
    5454 
    55     open my $fh, $file or Plagger->context->error("$file: $!"); 
     55    open my $fh, '<', $file or Plagger->context->error("$file: $!"); 
    5656    (my $pkg = $base) =~ s/\.pl$//; 
    5757    my $plugin_class = "Plagger::Plugin::Filter::FindEnclosures::Site::$pkg"; 
  • trunk/plagger/lib/Plagger/Plugin/Filter/HEADEnclosureMetadata.pm

    r1505 r1588  
    7171    my($res, $header) = @_; 
    7272 
    73     my $value = $res->header($header) or return undef; 
     73    my $value = $res->header($header) or return undef; ## no critic 
    7474    $value =~ s/;.*?$//; 
    7575    $value; 
  • trunk/plagger/lib/Plagger/Plugin/Filter/StripRSSAd.pm

    r758 r1588  
    3838    my($self, $file, $base) = @_; 
    3939 
    40     open my $fh, $file or Plagger->context->error("$file: $!"); 
     40    open my $fh, '<', $file or Plagger->context->error("$file: $!"); 
    4141    my $re = join '', <$fh>; 
    4242    chomp($re); 
  • trunk/plagger/lib/Plagger/Plugin/Publish/CHTML.pm

    r1454 r1588  
    121121    my $earlier; 
    122122    my $file = "$path/earlier"; 
    123     if (open my $in, $file) { 
     123    if (open my $in, '<', $file) { 
    124124        $earlier = <$in>; 
    125125        close $in; 
    126126    } 
    127     open my $out, ">$file" or $self->context->error("$file: $!"); 
     127    open my $out, ">", $file or $self->context->error("$file: $!"); 
    128128    print $out $self->id; 
    129129    close $out; 
  • trunk/plagger/lib/Plagger/Plugin/Publish/Pipe.pm

    r246 r1588  
    1515sub feed { 
    1616    my($self, $context, $args) = @_; 
    17      
    18     open my $out, "|" . $self->conf->{command} or $context->error("Can't open pipe: $!"); 
     17 
     18    open my $out, "|" . $self->conf->{command} or $context->error("Can't open pipe: $!"); ## no critic 
    1919    $context->log(info => "Publishing to " . $self->conf->{command}); 
    2020    for my $entry ($args->{feed}->entries) { 
  • trunk/plagger/lib/Plagger/Plugin/Subscription/Bookmarks/InternetExplorer.pm

    r994 r1588  
    11package Plagger::Plugin::Subscription::Bookmarks::InternetExplorer; 
     2use strict; 
    23use base qw( Plagger::Plugin::Subscription::Bookmarks ); 
    34 
  • trunk/plagger/lib/Plagger/Plugin/Subscription/Bookmarks/Mozilla.pm

    r998 r1588  
    11package Plagger::Plugin::Subscription::Bookmarks::Mozilla; 
     2use strict; 
    23use base qw( Plagger::Plugin::Subscription::XPath ); 
    34 
  • trunk/plagger/lib/Plagger/Plugin/Subscription/Bookmarks/Safari.pm

    r1488 r1588  
    11package Plagger::Plugin::Subscription::Bookmarks::Safari; 
     2use strict; 
    23use base qw( Plagger::Plugin::Subscription::Bookmarks ); 
    34 
  • trunk/plagger/lib/Plagger/Rule/Always.pm

    r78 r1588  
    11package Plagger::Rule::Always; 
     2use strict; 
    23use base qw( Plagger::Rule ); 
    34 
  • trunk/plagger/lib/Plagger/Walker.pm

    r1528 r1588  
    1919} 
    2020 
    21 sub apply($&;@) { 
     21sub apply($&;@) { ## no critic 
    2222    my $self = shift; 
    2323    my $code = shift;