From: Matt S Trout Date: Mon, 22 Nov 2010 13:28:35 +0000 (+0000) Subject: tweak extra testing to not fire user side X-Git-Tag: release_1.1.0~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=dca7f1843c8109c592235fc100b4a6c60aaa87da;p=p5sagit%2Fstrictures.git tweak extra testing to not fire user side --- diff --git a/Changes b/Changes new file mode 100644 index 0000000..fe41a2a --- /dev/null +++ b/Changes @@ -0,0 +1,3 @@ +1.1.0 + - enable extra testing only if .git or .svn present to keep requirement + for extra modules author-side diff --git a/lib/strictures.pm b/lib/strictures.pm index 68ca44c..cfb6e53 100644 --- a/lib/strictures.pm +++ b/lib/strictures.pm @@ -3,7 +3,7 @@ package strictures; use strict; use warnings FATAL => 'all'; -our $VERSION = '1.000000'; # 1.0.0 +our $VERSION = '1.001000'; # 1.1.0 sub VERSION { for ($_[1]) { @@ -20,7 +20,8 @@ sub import { if (exists $ENV{PERL_STRICTURES_EXTRA}) { $ENV{PERL_STRICTURES_EXTRA} } else { - !!($0 =~ /^x?t\/.*(?:load|compile|coverage).*\.t$/) + !!($0 =~ /^x?t\/.*(?:load|compile|coverage|use_ok).*\.t$/ + and (-e '.git' or -e '.svn')) } }; if ($do_indirect) { @@ -50,10 +51,11 @@ is equivalent to except when called from a file where $0 matches: - /^x?t\/.*(?:load|compile|coverage).*\.t$/ + /^x?t\/.*(?:load|compile|coverage|use_ok).*\.t$/ -or when the PERL_STRICTURES_EXTRA environment variable is set, in which -case +and when either '.git' or '.svn' is present in the current directory (with +the intention of only forcing extra tests on the author side) - or when the +PERL_STRICTURES_EXTRA environment variable is set, in which case use strictures 1;