From: Rafael Garcia-Suarez Date: Tue, 20 Dec 2005 14:54:10 +0000 (+0000) Subject: POD nits on B::Lint X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fa75652c1970cc67d47b9b046e2e323ec6b13df9;p=p5sagit%2Fp5-mst-13.2.git POD nits on B::Lint p4raw-id: //depot/perl@26421 --- diff --git a/ext/B/B/Lint.pm b/ext/B/B/Lint.pm index 253044d..58015b9 100644 --- a/ext/B/B/Lint.pm +++ b/ext/B/B/Lint.pm @@ -124,30 +124,29 @@ include other package names whose subs are then checked by Lint. Lint can be extended by registering plugins. -The Cregister_plugin( MyPlugin => \ @new_checks ) method +The C<< B::Lint->register_plugin( MyPlugin => \@new_checks ) >> method adds the class C to the list of plugins. It also adds the list of C<@new_checks> to the list of valid checks. -You must create a C method in your plugin class or -one of its inheritence parents. It will be called on every op as a -regular method call with a hash ref of checks as its parameter. +You must create a C method in your plugin class or one +of its parents. It will be called on every op as a regular method call +with a hash ref of checks as its parameter. -You may not alter the check hash reference. +You may not alter the %checks hash reference. -The class methods Cfile> and Cline> contain the -current filename and line number. +The class methods C<< B::Lint->file >> and C<< B::Lint->line >> contain +the current filename and line number. - package Sample; - use B::Lint; - B::Lint->register_plugin( Sample => [ 'good_taste' ] ); - - sub match { - my ( $op, $checks_href ) = shift; - - if ( $checks_href->{good_taste} ) { - ... - } - } + package Sample; + use B::Lint; + B::Lint->register_plugin( Sample => [ 'good_taste' ] ); + + sub match { + my ( $op, $checks_href ) = shift; + if ( $checks_href->{good_taste} ) { + ... + } + } =head1 BUGS @@ -226,6 +225,7 @@ sub B::OP::lint { $m = $_->can('match'), $op->$m( \ %check ) for @plugins; return; } + *$_ = *B::OP::lint for \ ( *B::PADOP::lint, *B::LOGOP::lint, @@ -456,13 +456,13 @@ sub compile { } } # Remaining arguments are things to check - + return \&do_lint; } sub register_plugin { my ( undef, $plugin, $new_checks ) = @_; - + # Register the plugin for my $check ( @$new_checks ) { defined $check @@ -471,12 +471,12 @@ sub register_plugin { or warn "$check is already registered as a B::Lint feature."; not $plugin_valid_check{ $check } or warn "$check is already registered as a $plugin_valid_check{$check} feature."; - + $plugin_valid_check{$check} = $plugin; } - + push @plugins, $plugin; - + return; }