Perl::Critic::Annotation - A "## no critic" annotation in a document. |
Perl::Critic::Annotation - A ``## no critic'' annotation in a document.
use Perl::Critic::Annotation; $annotation = Perl::Critic::Annotation->new( -element => $no_critic_ppi_element );
$bool = $annotation->disables_line( $number ); $bool = $annotation->disables_policy( $policy_object ); $bool = $annotation->disables_all_policies();
($start, $end) = $annotation->effective_range(); @disabled_policy_names = $annotation->disabled_policies();
Perl::Critic::Annotation
represents a single "## no critic"
annotation in a PPI:Document. The Annotation takes care of parsing
the annotation and keeps track of which lines and Policies it affects.
It is intended to encapsulate the details of the no-critic
annotations, and to provide a way for Policy objects to interact with
the annotations (via a Perl::Critic::Document).
This is considered to be a non-public class. Its interface is subject to change without notice.
"## no critic"
annotations and constructs a new Perl::Critic::Annotation
for each
one and returns them. The order of the returned objects is not
defined. It is generally expected that clients will use this
interface rather than calling the Perl::Critic::Annotation
constructor directly.
new( -element => $ppi_annotation_element )
PPI::Token::Comment
that
conforms to the "## no critic"
syntax.
disables_line( $line )
$line
for any (or all)
Policies.
disables_policy( $policy_object )
disables_policy( $policy_name )
$polciy_object
or
$policy_name
at any (or all) lines.
disables_all_policies()
disabled_policies
will return
an empty list.
effective_range()
disabled_policies()
disables_all_policies()
should
return true.
element()
Jeffrey Ryan Thalhammer <jeff@imaginative-software.com>
Copyright (c) 2005-2011 Imaginative Software Systems. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of this license can be found in the LICENSE file included with this module.
Perl::Critic::Annotation - A "## no critic" annotation in a document. |