Bladeren bron

Merge pull request #373 from Troglodyne-Internet-Widgets/localized-punctuation

Enable RequireLocalizedPunctuationVars, and remove two vestiges it found
George S. Baugh 6 dagen geleden
bovenliggende
commit
d6006ed417
5 gewijzigde bestanden met toevoegingen van 8 en 29 verwijderingen
  1. 1 1
      .perlcriticrc
  2. 0 3
      bin/tcms-useradd
  3. 0 3
      bin/tcmslogin
  4. 7 5
      git-hooks/pre-commit
  5. 0 17
      t/Trog-Auth-libravatar.t

+ 1 - 1
.perlcriticrc

@@ -294,7 +294,7 @@ allow_unused_subroutine_arguments = 1
 # allow_if_computed_by = Test::MockModule->new Test::MockFile->file
 [Variables::ProtectPrivateVars]
 [Variables::RequireLexicalLoopIterators]
-#[Variables::RequireLocalizedPunctuationVars]
+[Variables::RequireLocalizedPunctuationVars]
 [Variables::RequireNegativeIndices]
 # Extensions to perl -c
 #[CompileTime]

+ 0 - 3
bin/tcms-useradd

@@ -17,9 +17,6 @@ use Trog::Log;
 use Trog::Data;
 use Trog::Config;
 
-# Don't murder our terminal when done
-$ENV{NOHUP} = 1;
-
 =head1 SYNOPSIS
 
 Add or edit a tCMS user.  In the event of a user edit, every option save for user is optional,

+ 0 - 3
bin/tcmslogin

@@ -14,9 +14,6 @@ use IO::Prompter();
 use Trog::Auth;
 use Trog::Log;
 
-# Don't murder our terminal when done
-$ENV{NOHUP} = 1;
-
 =head1 SYNOPSIS
 
 Log a user in and print the resulting session cookie, so that you can hand it

+ 7 - 5
git-hooks/pre-commit

@@ -130,14 +130,16 @@ then
         perlcritic --profile .perlcriticrc $lib_files || critic_failed=1
     fi
 
-    # The same profile for t/, less one policy.  A test is not a module: nobody
+    # The same profile for t/, less two policies.  A test is not a module: nobody
     # runs perldoc on it, so requiring POD of it asks for a page no reader will
-    # ever open.  Everything else in the profile still judges it, which is more
-    # than a release does -- all_critic_ok() reads lib/ and not t/, so this hook
-    # is the only thing that looks at a test file at all.
+    # ever open.  And a test sets %ENV and %INC for the whole file, in a BEGIN
+    # block before the SUT loads, where a local would end with the block.
+    # Everything else in the profile still judges it, which is more than a
+    # release does -- all_critic_ok() reads lib/ and not t/, so this hook is the
+    # only thing that looks at a test file at all.
     if [ -n "$test_files" ]
     then
-        perlcritic --profile .perlcriticrc --exclude Documentation::RequirePod $test_files || critic_failed=1
+        perlcritic --profile .perlcriticrc --exclude Documentation::RequirePod --exclude Variables::RequireLocalizedPunctuationVars $test_files || critic_failed=1
     fi
 
     if [ -n "$critic_failed" ]

+ 0 - 17
t/Trog-Auth-libravatar.t

@@ -8,23 +8,6 @@ use Test::MockModule qw{strict};
 
 use FindBin::libs;
 
-# Stub modules absent from the test environment before loading Trog::Auth
-BEGIN {
-    # Logging stubs -- Log::Dispatch family not installed in test env
-    $INC{'Log/Dispatch.pm'}            = 1;
-    $INC{'Log/Dispatch/DBI.pm'}        = 1;
-    $INC{'Log/Dispatch/Screen.pm'}     = 1;
-    $INC{'Log/Dispatch/FileRotate.pm'} = 1;
-    $INC{'Trog/Log/DBI.pm'}            = 1;
-
-    # Other missing optional deps
-    $INC{'HTTP/Tiny/UNIX.pm'} = 1;
-    $INC{'File/LibMagic.pm'}  = 1;
-    $INC{'Imager/QRCode.pm'}  = 1;
-    $INC{'Config/Simple.pm'}  = 1;
-
-}
-
 require_ok('Trog::Auth') or BAIL_OUT("Can't load Trog::Auth");
 
 subtest 'users_with_emails -- no rows returned' => sub {