diff --git a/lib/MetaCPAN/API.pm b/lib/MetaCPAN/API.pm index b1d99fa59..ab7a9f66b 100644 --- a/lib/MetaCPAN/API.pm +++ b/lib/MetaCPAN/API.pm @@ -22,7 +22,6 @@ use Mojo::Base 'Mojolicious'; use File::Temp (); use List::Util qw( any ); use MetaCPAN::Script::Runner (); -use Search::Elasticsearch (); use Try::Tiny qw( catch try ); use MetaCPAN::Server::Config (); use MetaCPAN::Types::TypeTiny qw( ES ); diff --git a/lib/MetaCPAN/Document/Author.pm b/lib/MetaCPAN/Document/Author.pm index b0fe6b446..48296bb18 100644 --- a/lib/MetaCPAN/Document/Author.pm +++ b/lib/MetaCPAN/Document/Author.pm @@ -7,10 +7,9 @@ use ElasticSearchX::Model::Document::Types qw( Location ); use ElasticSearchX::Model::Document; # load order not important -use Gravatar::URL (); -use MetaCPAN::Document::Author::Profile (); -use MetaCPAN::Types qw( ESBool Profile ); -use MetaCPAN::Types::TypeTiny qw( +use Gravatar::URL (); +use MetaCPAN::Types qw( ESBool Profile ); +use MetaCPAN::Types::TypeTiny qw( ArrayRef ArrayRefPromote Blog diff --git a/lib/MetaCPAN/Document/File.pm b/lib/MetaCPAN/Document/File.pm index 14a586b91..97028fce2 100644 --- a/lib/MetaCPAN/Document/File.pm +++ b/lib/MetaCPAN/Document/File.pm @@ -10,19 +10,11 @@ use ElasticSearchX::Model::Document; use List::Util qw( any ); use MetaCPAN::Document::Module (); use MetaCPAN::Types qw( ESBool Module ); -use MetaCPAN::Types::TypeTiny qw( - ArrayRef - Int - Maybe - Num - ScalarRef - Stat - Str -); -use MetaCPAN::Util qw(numify_version true false); -use Plack::MIME (); -use Pod::Text (); -use Try::Tiny qw( catch try ); +use MetaCPAN::Types::TypeTiny qw( ArrayRef Int Maybe Num ScalarRef Stat Str ); +use MetaCPAN::Util qw(numify_version true false); +use Plack::MIME (); +use Pod::Text (); +use Try::Tiny qw( catch try ); Plack::MIME->add_type( '.t' => 'text/x-script.perl' ); Plack::MIME->add_type( '.pod' => 'text/x-pod' ); diff --git a/lib/MetaCPAN/Document/Release.pm b/lib/MetaCPAN/Document/Release.pm index e1a477b9d..ad92baf61 100644 --- a/lib/MetaCPAN/Document/Release.pm +++ b/lib/MetaCPAN/Document/Release.pm @@ -3,9 +3,8 @@ package MetaCPAN::Document::Release; use Moose; use ElasticSearchX::Model::Document; -use MetaCPAN::Document::Dependency (); -use MetaCPAN::Types qw( ESBool Dependency ); -use MetaCPAN::Types::TypeTiny qw( +use MetaCPAN::Types qw( Dependency ESBool ); +use MetaCPAN::Types::TypeTiny qw( ArrayRef HashRefCPANMeta Num diff --git a/lib/MetaCPAN/Model.pm b/lib/MetaCPAN/Model.pm index f45cdea28..e98d5ac6e 100644 --- a/lib/MetaCPAN/Model.pm +++ b/lib/MetaCPAN/Model.pm @@ -5,7 +5,7 @@ use Moose; use ElasticSearchX::Model; use MetaCPAN::ESConfig qw(es_config); -use Module::Runtime qw(require_module use_package_optimistically); +use Module::Runtime qw( require_module use_package_optimistically ); my %indexes; my $docs = es_config->documents; diff --git a/lib/MetaCPAN/Model/User/Account.pm b/lib/MetaCPAN/Model/User/Account.pm index c82fb433a..bfb37ce31 100644 --- a/lib/MetaCPAN/Model/User/Account.pm +++ b/lib/MetaCPAN/Model/User/Account.pm @@ -6,10 +6,9 @@ use warnings; use Moose; use ElasticSearchX::Model::Document; -use MetaCPAN::Model::User::Identity (); -use MetaCPAN::Types qw( ESBool Identity ); -use MetaCPAN::Types::TypeTiny qw( ArrayRef Dict Str ); -use MetaCPAN::Util qw(true false); +use MetaCPAN::Types qw( Identity ); +use MetaCPAN::Types::TypeTiny qw( ArrayRef Dict Str ); +use MetaCPAN::Util qw(true false); =head1 PROPERTIES diff --git a/lib/MetaCPAN/Query/Search.pm b/lib/MetaCPAN/Query/Search.pm index 9628e55db..d5cf21897 100644 --- a/lib/MetaCPAN/Query/Search.pm +++ b/lib/MetaCPAN/Query/Search.pm @@ -2,13 +2,12 @@ package MetaCPAN::Query::Search; use MetaCPAN::Moose; -use Const::Fast qw( const ); -use Hash::Merge qw( merge ); -use List::Util qw( min uniq ); -use Log::Contextual qw( :log :dlog ); -use MetaCPAN::ESConfig qw( es_doc_path ); -use MetaCPAN::Types::TypeTiny qw( Object Str ); -use MetaCPAN::Util qw( MAX_RESULT_WINDOW hit_total true false ); +use Const::Fast qw( const ); +use Hash::Merge qw( merge ); +use List::Util qw( min uniq ); +use Log::Contextual qw( :log :dlog ); +use MetaCPAN::ESConfig qw( es_doc_path ); +use MetaCPAN::Util qw( MAX_RESULT_WINDOW hit_total true false ); use MooseX::StrictConstructor; with 'MetaCPAN::Query::Role::Common'; diff --git a/lib/MetaCPAN/Script/Backup.pm b/lib/MetaCPAN/Script/Backup.pm index 6085caabb..2ced44ea0 100644 --- a/lib/MetaCPAN/Script/Backup.pm +++ b/lib/MetaCPAN/Script/Backup.pm @@ -8,7 +8,7 @@ use Cpanel::JSON::XS qw( decode_json encode_json ); use DateTime (); use IO::Zlib (); use Log::Contextual qw( :log :dlog ); -use MetaCPAN::Types::TypeTiny qw( Bool Int Path Str CommaSepOption ); +use MetaCPAN::Types::TypeTiny qw( Bool CommaSepOption Int Path Str ); use MetaCPAN::Util qw( true false ); use MetaCPAN::ESConfig qw( es_config ); use Moose; diff --git a/lib/MetaCPAN/Script/Contributor.pm b/lib/MetaCPAN/Script/Contributor.pm index fbeb6cf46..230216060 100644 --- a/lib/MetaCPAN/Script/Contributor.pm +++ b/lib/MetaCPAN/Script/Contributor.pm @@ -5,9 +5,7 @@ use warnings; use Moose; -use MetaCPAN::ESConfig qw( es_doc_path ); -use Log::Contextual qw( :log ); -use Ref::Util qw( is_arrayref ); +use Log::Contextual qw( :log ); use MetaCPAN::Types::TypeTiny qw( Bool HashRef Int Str ); diff --git a/lib/MetaCPAN/Script/Role/Contributor.pm b/lib/MetaCPAN/Script/Role/Contributor.pm index c2384f488..280091b17 100644 --- a/lib/MetaCPAN/Script/Role/Contributor.pm +++ b/lib/MetaCPAN/Script/Role/Contributor.pm @@ -5,7 +5,7 @@ use Moose::Role; use Log::Contextual qw( :log :dlog ); use MetaCPAN::ESConfig qw( es_doc_path ); use MetaCPAN::Util qw( true false ); -use Ref::Util qw( is_arrayref ); +use Ref::Util (); sub update_contributors { my ( $self, $query ) = @_; diff --git a/lib/MetaCPAN/Script/Snapshot.pm b/lib/MetaCPAN/Script/Snapshot.pm index dade43dc7..23054f12d 100644 --- a/lib/MetaCPAN/Script/Snapshot.pm +++ b/lib/MetaCPAN/Script/Snapshot.pm @@ -8,7 +8,6 @@ use DateTime (); use DateTime::Format::ISO8601 (); use HTTP::Tiny (); use Log::Contextual qw( :log :dlog ); -use MetaCPAN::Server::Config (); use MetaCPAN::Types::TypeTiny qw( ArrayRef Bool Str Uri ); use Moose; use Sys::Hostname qw( hostname ); diff --git a/lib/MetaCPAN/Types/TypeTiny.pm b/lib/MetaCPAN/Types/TypeTiny.pm index e3bd2b8b9..bf93d4ca2 100644 --- a/lib/MetaCPAN/Types/TypeTiny.pm +++ b/lib/MetaCPAN/Types/TypeTiny.pm @@ -3,6 +3,7 @@ package MetaCPAN::Types::TypeTiny; use strict; use warnings; +use Search::Elasticsearch (); use Type::Library -base, -declare => ( qw( ArrayRefPromote diff --git a/lib/MetaCPAN/Util.pm b/lib/MetaCPAN/Util.pm index 1dd745c5f..77b0855ae 100644 --- a/lib/MetaCPAN/Util.pm +++ b/lib/MetaCPAN/Util.pm @@ -6,19 +6,19 @@ use strict; use warnings; use version; -use Cwd (); -use Digest::SHA qw( sha1_base64 sha1_hex ); -use Encode qw( decode_utf8 ); -use File::Basename (); -use File::Spec (); -use Ref::Util qw( +use Cpanel::JSON::XS (); ## no perlimports +use Cwd (); +use Digest::SHA qw( sha1_base64 sha1_hex ); +use Encode qw( decode_utf8 ); +use File::Basename (); +use File::Spec (); +use Ref::Util qw( is_arrayref is_hashref is_plain_arrayref is_plain_hashref is_ref ); -use Cpanel::JSON::XS (); use Sub::Exporter -setup => { exports => [ qw( root_dir diff --git a/t/lib/MetaCPAN/TestServer.pm b/t/lib/MetaCPAN/TestServer.pm index e2ddf311d..f37309960 100644 --- a/t/lib/MetaCPAN/TestServer.pm +++ b/t/lib/MetaCPAN/TestServer.pm @@ -21,7 +21,6 @@ use MetaCPAN::TestHelpers qw( fakecpan_dir ); use MetaCPAN::Types::TypeTiny qw( HashRef Path ); use MetaCPAN::Util qw( true false ); use MooseX::Types::ElasticSearch qw( ES ); -use Search::Elasticsearch (); use Test::More; has es_client => ( diff --git a/t/lib/MetaCPAN/Tests/Query.pm b/t/lib/MetaCPAN/Tests/Query.pm index 3931d11d7..4a2f034f4 100644 --- a/t/lib/MetaCPAN/Tests/Query.pm +++ b/t/lib/MetaCPAN/Tests/Query.pm @@ -4,7 +4,7 @@ use Test::Routine; use MetaCPAN::ESConfig qw( es_doc_path ); use MetaCPAN::Server::Test (); -use MetaCPAN::Types::TypeTiny qw( ES ArrayRef HashRef InstanceOf Str ); +use MetaCPAN::Types::TypeTiny qw( ES HashRef Str ); use Test::More; use Try::Tiny qw( try ); diff --git a/t/query.t b/t/query.t index 0e07504d1..25b789053 100644 --- a/t/query.t +++ b/t/query.t @@ -3,10 +3,10 @@ use warnings; use lib 't/lib'; -use MetaCPAN::Query; +use MetaCPAN::Query (); use MetaCPAN::Server::Test (); use Test::More; -use Scalar::Util qw(weaken refaddr); +use Scalar::Util qw( refaddr weaken ); my $es = MetaCPAN::Server::Test::es(); diff --git a/t/query/release.t b/t/query/release.t index e1f8c1526..fa8687177 100644 --- a/t/query/release.t +++ b/t/query/release.t @@ -3,7 +3,7 @@ use warnings; use lib 't/lib'; -use MetaCPAN::Server::Test qw(query); +use MetaCPAN::Server::Test qw( query ); use Test::More; my $query = query()->release; diff --git a/t/release/moose.t b/t/release/moose.t index 722eaba4e..f7f2bdd09 100644 --- a/t/release/moose.t +++ b/t/release/moose.t @@ -2,7 +2,7 @@ use strict; use warnings; use lib 't/lib'; -use MetaCPAN::Server::Test qw( query es_result ); +use MetaCPAN::Server::Test qw( es_result query ); use MetaCPAN::Util qw( true false ); use Test::More; diff --git a/t/release/multiple-modules.t b/t/release/multiple-modules.t index 533eeaf41..2e24213f8 100644 --- a/t/release/multiple-modules.t +++ b/t/release/multiple-modules.t @@ -2,7 +2,7 @@ use strict; use warnings; use lib 't/lib'; -use MetaCPAN::Server::Test qw( query es_result ); +use MetaCPAN::Server::Test qw( es_result ); use MetaCPAN::Util qw(true false); use Test::More; diff --git a/t/release/pm-PL.t b/t/release/pm-PL.t index 3facfb9c5..8c17e73bc 100644 --- a/t/release/pm-PL.t +++ b/t/release/pm-PL.t @@ -3,7 +3,7 @@ use warnings; use lib 't/lib'; use MetaCPAN::ESConfig qw( es_doc_path ); -use MetaCPAN::Server::Test qw( app GET query es test_psgi ); +use MetaCPAN::Server::Test qw( app es GET query test_psgi ); use Test::More; my $query = query(); diff --git a/t/release/pod-with-data-token.t b/t/release/pod-with-data-token.t index 5799e09f3..5bcd5115a 100644 --- a/t/release/pod-with-data-token.t +++ b/t/release/pod-with-data-token.t @@ -2,7 +2,6 @@ use strict; use warnings; use lib 't/lib'; -use Cpanel::JSON::XS (); use MetaCPAN::TestHelpers qw( test_release ); use MetaCPAN::Util qw( true false ); use Test::More; diff --git a/t/release/pod-with-generator.t b/t/release/pod-with-generator.t index ae68685eb..74d3a89f9 100644 --- a/t/release/pod-with-generator.t +++ b/t/release/pod-with-generator.t @@ -2,7 +2,6 @@ use strict; use warnings; use lib 't/lib'; -use Cpanel::JSON::XS (); use MetaCPAN::TestHelpers qw( test_release ); use MetaCPAN::Util qw(true false); use Test::More;