以下の内容はhttps://hiratara.hatenadiary.jp/entry/20090414/1239691691より取得しました。


Moose と "Code before strictures are enabled"

Perl::Criticのバージョンが古いと、Mooseを使ってる箇所のテストで「Code before strictures are enabled」が出ます。

うちのバージョンを見たら1.080*1でした。最新バージョンでは、

There are special exemptions for Moose, Moose::Role, and Moose::Util::TypeConstraints because they enforces strictness; e.g. 'use Moose' is treated as equivalent to 'use strict'.

Perl::Critic::Policy::TestingAndDebugging::RequireUseStrict

と素敵仕様に。ただし、他にも MooseX::* のようにstrict強制な物があると思うので、そう言う時は perlcriticrc ファイルに、

[TestingAndDebugging::RequireUseStrict]
equivalent_modules = MooseX::POE

と書きましょう*2

*1:2007-11-11のバージョン

*2:1.080ではこのオプションはないみたい。




以上の内容はhttps://hiratara.hatenadiary.jp/entry/20090414/1239691691より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14