From 4632132d02064c3e6d2f5cd29e28e1f06e368f6d Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 19 Aug 2021 16:25:21 -0400 Subject: [PATCH] fixup perlcritic: indirect new > Subroutine new called using indirect syntax at line 14, column 14. See page 349 of PBP. (Severity: 5) --- src/lib/Hydra/Controller/User.pm | 4 ++-- src/lib/Hydra/Helper/Nix.pm | 2 +- src/lib/Hydra/View/NixClosure.pm | 2 +- src/lib/Hydra/View/NixLog.pm | 2 +- src/lib/Hydra/View/NixNAR.pm | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib/Hydra/Controller/User.pm b/src/lib/Hydra/Controller/User.pm index 49c49c84..852dd16d 100644 --- a/src/lib/Hydra/Controller/User.pm +++ b/src/lib/Hydra/Controller/User.pm @@ -143,7 +143,7 @@ sub google_login :Path('/google-login') Args(0) { error($c, "Logging in via Google is not enabled.") unless $c->config->{enable_google_login}; - my $ua = new LWP::UserAgent; + my $ua = LWP::UserAgent->new(); my $response = $ua->post( 'https://www.googleapis.com/oauth2/v3/tokeninfo', { id_token => ($c->stash->{params}->{id_token} // die "No token."), @@ -171,7 +171,7 @@ sub github_login :Path('/github-login') Args(0) { }; die "No github secret configured" unless $client_secret; - my $ua = new LWP::UserAgent; + my $ua = LWP::UserAgent->new(); my $response = $ua->post( 'https://github.com/login/oauth/access_token', { diff --git a/src/lib/Hydra/Helper/Nix.pm b/src/lib/Hydra/Helper/Nix.pm index 5e055e4f..7ab4ab60 100644 --- a/src/lib/Hydra/Helper/Nix.pm +++ b/src/lib/Hydra/Helper/Nix.pm @@ -44,7 +44,7 @@ sub getHydraConfig { my $conf = $ENV{"HYDRA_CONFIG"} || (Hydra::Model::DB::getHydraPath . "/hydra.conf"); my %opts = (%Hydra::Config::configGeneralOpts, -ConfigFile => $conf); if (-f $conf) { - my %h = new Config::General(%opts)->getall; + my %h = Config::General->new(%opts)->getall; $hydraConfig = \%h; } else { diff --git a/src/lib/Hydra/View/NixClosure.pm b/src/lib/Hydra/View/NixClosure.pm index 51376699..d906dce3 100644 --- a/src/lib/Hydra/View/NixClosure.pm +++ b/src/lib/Hydra/View/NixClosure.pm @@ -11,7 +11,7 @@ sub process { my @storePaths = @{$c->stash->{storePaths}}; - my $fh = new IO::Handle; + my $fh = IO::Handle->new(); open $fh, "nix-store --export `nix-store -qR @storePaths` | gzip |"; diff --git a/src/lib/Hydra/View/NixLog.pm b/src/lib/Hydra/View/NixLog.pm index 8103726d..fb9e0e1f 100644 --- a/src/lib/Hydra/View/NixLog.pm +++ b/src/lib/Hydra/View/NixLog.pm @@ -11,7 +11,7 @@ sub process { $c->response->content_type('text/plain; charset=utf-8'); - my $fh = new IO::Handle; + my $fh = IO::Handle->new(); my $tail = int($c->stash->{tail} // "0"); diff --git a/src/lib/Hydra/View/NixNAR.pm b/src/lib/Hydra/View/NixNAR.pm index 350ee8e9..e1798275 100644 --- a/src/lib/Hydra/View/NixNAR.pm +++ b/src/lib/Hydra/View/NixNAR.pm @@ -13,7 +13,7 @@ sub process { $c->response->content_type('application/x-nix-archive'); # !!! check MIME type - my $fh = new IO::Handle; + my $fh = IO::Handle->new(); open $fh, "nix-store --dump '$storePath' | pixz -0 $pParam |";