[SP-pm] Critic... too much

breno breno at rio.pm.org
Fri Feb 18 16:50:51 PST 2011


2011/2/18 Alexei Znamensky <russoz em gmail.com>:
> Moçada,
> Estou colocando o teste com o perl critic em um módulo, e ele está dando
> (entre outros) os seguintes erros:
> # Perl::Critic found these violations in "blib/lib/Queue/Base.pm":
> # Code before strictures are enabled at line 3, column 1.  See page 429 of
> PBP.  (Severity: 5)
> # Code before warnings are enabled at line 3, column 1.  See page 431 of
> PBP.  (Severity: 4)
> Mas o começo do arquivo está assim:
> ------ 8< ------ 8< ------ 8< ------ 8< ------ 8< ------ 8< ------ 8< ------
> 8< ------ 8< ------ 8< ------ 8< ------
> package Queue::Base;
> use strict;
> use warnings;
> use Carp;
> sub new {
> ------ >8 ------ >8 ------ >8 ------ >8 ------ >8 ------ >8 ------ >8 ------
>>8 ------ >8 ------ >8 ------ >8 ------
> WTF???
> Eu tentei colocar o strict e o warnings antes do package, mas daí ele
> reclamou que estou fazendo coisas que não estão em um package... *sigh*

Fala Russo!

Não consegui reproduzir o seu problema:

---------------8<---------------
package Teste;
use strict;
use warnings;

use Carp;

sub new {
}

1;
--------------->8---------------

garu em bebop:~/tmp$ perlcritic Teste.pm
Teste.pm source OK

garu em bebop:~/tmp$ perlcritic --brutal --exclude RCS Teste.pm
No package-scoped "$VERSION" variable found at line 1, column 1.  See
page 404 of PBP.  (Severity: 2)

[]s

-b


More information about the SaoPaulo-pm mailing list