Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

precious tidy #1363

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion lib/MetaCPAN/API.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
7 changes: 3 additions & 4 deletions lib/MetaCPAN/Document/Author.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 5 additions & 13 deletions lib/MetaCPAN/Document/File.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
Expand Down
5 changes: 2 additions & 3 deletions lib/MetaCPAN/Document/Release.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/MetaCPAN/Model.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 3 additions & 4 deletions lib/MetaCPAN/Model/User/Account.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 6 additions & 7 deletions lib/MetaCPAN/Query/Search.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion lib/MetaCPAN/Script/Backup.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 1 addition & 3 deletions lib/MetaCPAN/Script/Contributor.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

Expand Down
2 changes: 1 addition & 1 deletion lib/MetaCPAN/Script/Role/Contributor.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) = @_;
Expand Down
1 change: 0 additions & 1 deletion lib/MetaCPAN/Script/Snapshot.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
1 change: 0 additions & 1 deletion lib/MetaCPAN/Util.pm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ use Ref::Util qw(
is_plain_hashref
is_ref
);
use Cpanel::JSON::XS ();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This removal is wrong. There are subs manually imported from this package later in the file.

use Sub::Exporter -setup => {
exports => [ qw(
root_dir
Expand Down
1 change: 0 additions & 1 deletion t/lib/MetaCPAN/TestServer.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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 => (
Expand Down
2 changes: 1 addition & 1 deletion t/lib/MetaCPAN/Tests/Query.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

Expand Down
4 changes: 2 additions & 2 deletions t/query.t
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion t/query/release.t
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion t/release/moose.t
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion t/release/multiple-modules.t
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion t/release/pm-PL.t
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
1 change: 0 additions & 1 deletion t/release/pod-with-data-token.t
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion t/release/pod-with-generator.t
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down