Perl::Critic::Policy::CodeLayout::TabIndentSpaceAlign - Use tabs for indenting, spaces for aligning.
Version 1.0.2
This is a standalone policy not part of a larger PerlCritic Policies group.
Hard tabs are a perfectly fine way to indent code for accessibility and usability purposes, allowing different users to tweak indentation settings to suit their needs and habits. However, hard tabs should not be used for formatting / aligning, as this makes the display dependent on the tab-to-space ratio of the user.
Perl/Critic/Policy/CodeLayout/ProhibitHardTabs has a setting that allows leading tabs, but this not not fully represent the paradigm where tabs are reserved for indenting and spaces for formatting/aligning. In particular, it does not prevent indenting with spaces, while this module detects and prevents it.
Perl/Critic/Policy/CodeLayout/ProhibitHardTabs
This Policy examines your source code, including POD, quotes, and HEREDOCs. The contents of the __DATA__ section are not examined.
__DATA__
There is no configuration option available for this policy.
Beware that Perl::Critic may report the location of the string that contains the tab, not the actual location of the tab, so you may need to do some hunting.
Return an array with information about the parameters supported.
my @supported_parameters = $policy->supported_parameters();
Return the default severify for this policy.
my $default_severity = $policy->default_severity();
Return the default themes this policy is included in.
my $default_themes = $policy->default_themes();
Return the class of elements this policy applies to.
my $class = $policy->applies_to();
Check an element for violations against this policy.
my $policy->violates( $element, $document, );
Return a boolean indicating if a multiline string has violations against this policy.
my $string_has_violations = _has_violations_in_multiline_string( $string );
Guillaume Aubert, <aubertg at cpan.org>.
<aubertg at cpan.org>
Please report any bugs or feature requests to bug-perl-critic-policy-codelayout-tabindentspacealign at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Perl-Critic-Policy-CodeLayout-TabIndentSpaceAlign. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-perl-critic-policy-codelayout-tabindentspacealign at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Perl::Critic::Policy::CodeLayout::TabIndentSpaceAlign
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Perl-Critic-Policy-CodeLayout-TabIndentSpaceAlign
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Perl-Critic-Policy-CodeLayout-TabIndentSpaceAlign
CPAN Ratings
http://cpanratings.perl.org/d/Perl-Critic-Policy-CodeLayout-TabIndentSpaceAlign
Search CPAN
http://search.cpan.org/dist/Perl-Critic-Policy-CodeLayout-TabIndentSpaceAlign/
Thanks to ThinkGeek (http://www.thinkgeek.com/) and its corporate overlords at Geeknet (http://www.geek.net/), for footing the bill while I write code for them!
Copyright 2012 Guillaume Aubert.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/
To install Perl::Critic::Policy::CodeLayout::TabIndentSpaceAlign, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Perl::Critic::Policy::CodeLayout::TabIndentSpaceAlign
CPAN shell
perl -MCPAN -e shell install Perl::Critic::Policy::CodeLayout::TabIndentSpaceAlign
For more information on module installation, please visit the detailed CPAN module installation guide.