Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Perl-Critic CPAN distribution.

Report information
The Basics
Id: 14784
Status: resolved
Priority: 0/
Queue: Perl-Critic

People
Owner: thaljef [...] cpan.org
Requestors: cpan [...] ali.as
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.08_02
Fixed in: 0.10



Subject: Add policy CodeLayout::ProhibitHardTabs
We can add a policy that prohibits hard tabs, as recommended by PBP. Interestingly, Damian's original version said "tabs for indentation, but NEVER after the beginning of the line". I completely concur. He switched to "No tabs anywhere" because he felt that by allowing leading tabs, it would be too much of a temptation. Well then, we can fix that :) Do the search as a straight up token search. That covers __END__ stuff and what have you. sub wanted { my ($Document, $Element) = @_; $Element->isa('PPI::Token') or return ''; $Element->content =~ /\t/ ? 1 : ''; } There needs to be an option to have EITHER just bitch about non-leading tabs (I suggest this as the default), or all tabs anywhere (the PBP strict version). On a side note, I just got my funding for PPI phase 2 (infrastructure and taking PPI towards refacatoring editors), so I'm hoping to get a bit more involved with Perl::Critic some time soon. The thing I really really want at this point would be Perl::Critic::Policy::AutoCorrectable. :) I think you can guess what that would do. Adam K
From: kclark [...] cpan.org
I would second this. In fact, I find hard tabs in the Perl::Critic code itself! I would like to see these go away as the code doesn't line up for me in vim using tabstop of 4. ky
Done. -Jeff