jonswar/perl-code-tidyall — pull request #8 by holybit (2012-10-15 14:31:19+00:00)
Title: PHPCodeSniffer Support

Good start, but not sure how to handle cases where phpcs says
the code is clean. The difference is phpcs will exit 0 when code
is clean and non zero otherwise. Don't know how in TidyAll to trap
on that.

A sample of some clean code sniffed by phpcs:

$ tidyall -a
[checked] views/TwigExtensionFilters.class.php
Time: 0 seconds, Memory: 3.00Mb
$ echo $?
0

Not sure how to fine tune the die which I just copied from Perl::Critic.
```perl
sub validate_file {
my ( $self, $file ) = @_;

my $cmd = sprintf( "%s %s %s", $self->cmd, $self->argv, $file );
my $output = capture_merged { system($cmd) };
die "$output\n" if $output !~ /^.* source OK\n/;
}
```