Как установить Perl критик на OSX?

Я пытался скачать, распаковать, следуйте инструкциям:

  tar -zxf Perl-Critic-1.107_001.tar.gz
    cd Perl-Critic-1.107_001
    perl Makefile.PL
    make
    make test
    make install

Когда я добираюсь до этапа изготовления, я получаю:

/usr/bin/perl "-Iblib/arch" "-Iblib/lib" t/Variables/RequireLocalizedPunctuationVars.run.PL t/Variables/RequireLocalizedPunctuationVars.run
Can't locate B/Keywords.pm in @INC (@INC contains: blib/arch blib/lib /Library/Perl/5.12/darwin-thread-multi-2level /Library/Perl/5.12 /Network/Library/Perl/5.12/darwin-thread-multi-2level /Network/Library/Perl/5.12 /Library/Perl/Updates/5.12.3 /System/Library/Perl/5.12/darwin-thread-multi-2level /System/Library/Perl/5.12 /System/Library/Perl/Extras/5.12/darwin-thread-multi-2level /System/Library/Perl/Extras/5.12 .) at t/Variables/RequireLocalizedPunctuationVars.run.PL line 16.
BEGIN failed--compilation aborted at t/Variables/RequireLocalizedPunctuationVars.run.PL line 16.
make: *** [t/Variables/RequireLocalizedPunctuationVars.run] Error 2

Я подозреваю это, потому что мне не хватает зависимости. Я также нашел эту задачу - https://metacpan.org/pod/Task%3A%3APerl%3A%3ACritic, которая кажется интересной, но не имеет указаний о том, как бежать.

--- РЕДАКТИРОВАТЬ После запуска - sudo cpan Task::Perl::Critic

Я получаю эти результаты:

Test Summary Report
-------------------
t/20_policies.t (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/pod.t         (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
Files=5, Tests=5,  0 wallclock secs ( 0.02 usr  0.01 sys +  0.08 cusr  0.01 csys =  0.12 CPU)
Result: FAIL
Failed 2/5 test programs. 0/5 subtests failed.
make: *** [test_dynamic] Error 255
  MARCELO/Perl-Critic-Itch-0.07.tar.gz
  /usr/bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports MARCELO/Perl-Critic-Itch-0.07.tar.gz
Running make install
  make test had returned bad status, won't install without force
Running Build for T/TH/THALJEF/Task-Perl-Critic-1.008.tar.gz
  Has already been unwrapped into directory /Users/joelnylund/.cpan/build/Task-Perl-Critic-1.008-g5bmDk

  CPAN.pm: Going to build T/TH/THALJEF/Task-Perl-Critic-1.008.tar.gz

Warning: Prerequisite 'Perl::Critic::PetPeeves::JTRAMMELL => 0.01' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'JTRAMMELL/Perl-Critic-PetPeeves-JTRAMMELL-0.03.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'Perl::Critic::Dynamic => 0.05' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'THALJEF/Perl-Critic-Dynamic-0.05.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'Test::Perl::Critic::Progressive => 0.03' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'THALJEF/Test-Perl-Critic-Progressive-0.03.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'Perl::Critic::Compatibility => 1.000' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'ELLIOTJS/Perl-Critic-Compatibility-1.001.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'Perl::Critic::Swift => 1.000003' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'ELLIOTJS/Perl-Critic-Swift-v1.0.3.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'Perl::Critic::Lax => 0.007' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'RJBS/Perl-Critic-Lax-0.009.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'Perl::Critic::Bangs => 1.00' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'PETDANCE/Perl-Critic-Bangs-1.10.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'Perl::Critic::More => 1.000' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'ELLIOTJS/Perl-Critic-More-1.000.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'Perl::Critic::Tics => 0.005' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'RJBS/Perl-Critic-Tics-0.007.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'Perl::Critic => 1.117' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'THALJEF/Perl-Critic-1.118.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'Perl::Critic::Pulp => 3' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'KRYDE/Perl-Critic-Pulp-80.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'Perl::Critic::Storable => 0' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'MATTD/Perl-Critic-Storable-0.01.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'Test::Perl::Critic => 1.02' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'THALJEF/Test-Perl-Critic-1.02.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'criticism => 1.02' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'THALJEF/criticism/criticism-1.02.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'Perl::Critic::StricterSubs => 0.03' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'THALJEF/strictersubs/Perl-Critic-StricterSubs-0.03.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'Perl::Critic::Nits => 1.000000' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'KCOWGILL/Perl-Critic-Nits-v1.0.0.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'Perl::Critic::Itch => 0' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'MARCELO/Perl-Critic-Itch-0.07.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Building Task-Perl-Critic
  THALJEF/Task-Perl-Critic-1.008.tar.gz
  ./Build -- OK
Running Build test
t/00_load.t .......... 1/1 # Testing Task::Perl::Critic 1.008
t/00_load.t .......... ok   
t/98_pod_syntax.t .... ok   
t/99_pod_coverage.t .. skipped: Test::Pod::Coverage 1.00 requried to test POD
All tests successful.
Files=3, Tests=2,  0 wallclock secs ( 0.02 usr  0.01 sys +  0.07 cusr  0.02 csys =  0.12 CPU)
Result: PASS
  THALJEF/Task-Perl-Critic-1.008.tar.gz
Tests succeeded but 18 dependencies missing (Perl::Critic::Storable,Perl::Critic::PetPeeves::JTRAMMELL,Perl::Critic::Dynamic,Test::Perl::Critic::Progressive,Test::Perl::Critic,Perl::Critic::Compatibility,Perl::Critic::Swift,Perl::Critic::Moose,Perl::Critic::Lax,criticism,Perl::Critic::Bangs,Perl::Critic::More,Perl::Critic::StricterSubs,Perl::Critic::Tics,Perl::Critic::Nits,Perl::Critic,Perl::Critic::Pulp,Perl::Critic::Itch)
  THALJEF/Task-Perl-Critic-1.008.tar.gz
  [dependencies] -- NA
Running Build install
  make test had returned bad status, won't install without force

3 ответа

Решение

Ну, кажется, этот ужасный совет был единственным, который сработал, из комментариев, которые я сделал:

 cpan
 force install Task::Perl::Critic

И, похоже, это работает до сих пор... Я просмотрел около десятка Perl-файлов, и результаты, кажется, то, что я искал...

Вы, вероятно, не хотите устанавливать Task::Perl::Critic, Он включает в себя множество плагинов с дополнительными политиками, написанными другими авторами. Некоторые из них будут конфликтовать друг с другом (то есть подчинение одному означает нарушение другого). И согласно сообщениям об ошибках, которые вы показали выше, эти плагины являются источником ошибок теста, а не Perl::Critic сам.

Установка Perl::Critic одного должно быть достаточно. Как и предполагали другие, используйте cpan полезность:

sudo cpan Perl::Critic

Это позаботится обо всех зависимостях для вас.

Возможно, вы захотите сначала позаботиться об установке Perl.

На Биг-Суре я заметил пропавшую keywords.h, следовательно force install B::Keywords.

Это сработало для меня:

          # cpan
    install CPAN
    reload cpan
    install Term::ReadLine::Perl
    install Log::Log4perl
    upgrade
    force install B::Keywords
    install Perl::Critic
Другие вопросы по тегам