App-CPANTS-Lint-0.05/0000755000175000017500000000000012446205117014214 5ustar ishigakiishigakiApp-CPANTS-Lint-0.05/README0000644000175000017500000000720312446204016015073 0ustar ishigakiishigakiNAME App::CPANTS::Lint - front-end to Module::CPANTS::Analyse SYNOPSIS use App::CPANTS::Lint; my $app = App::CPANTS::Lint->new(verbose => 1); $app->lint('path/to/Foo-Dist-1.42.tgz') or print $app->report; # if you need raw data $app->lint('path/to/Foo-Dist-1.42.tgz') or return $app->result; # if you need to look at the details of analysis $app->lint('path/to/Foo-Dist-1.42.tgz'); print Data::Dumper::Dumper($app->stash); DESCRIPTION App::CPANTS::Lint is a core of "cpants_lint.pl" script to check the Kwalitee of a distribution. See the script for casual usage. You can also use this from other modules for finer control. METHODS new Takes an optional hash (which will be passed into Module::CPANTS::Analyse internally) and creates a linter object. Available options are: verbose Makes Module::CPANTS::Analyse verbose. False by default. core_only If true, the "lint" method (see below) returns true even if "extra" metrics (as well as "experimental" metrics) fail. This may be useful if you only care Kwalitee rankings. False by default. experimental If true, failed "experimental" metrics are also reported (via "report" method). False by default. Note that "experimental" metrics are not taken into account while calculating a score. save If true, "output_report" method writes to a file instead of writing to STDOUT. dump, yaml, json If true, "report" method returns a formatted dump of the stash (see below). search_path If you'd like to use extra metrics modules, pass a reference to an array of their parent namespace(s) to search. Metrics modules under Module::CPANTS::Kwalitee namespace are always used. lint Takes a path to a distribution tarball and analyses it. Returns true if the distribution has no significant issues (experimental metrics are always ignored). Otherwise, returns false. Note that the result doesn't always match with what is shown at the CPANTS website, because there are metrics that are only available at the site for various reasons (some of them require database connection, and some are not portable enough). report Returns a report string that contains the details of failed metrics (even if "lint" method returns true) and a Kwalitee score. If "dump" (or "yaml", "json") is set when you create an App::CPANTS::Lint object, "report" returns a formatted dump of the stash. result Returns a reference to a hash that contains the details of failed metrics and a Kwalitee score. Internal structure may change without notice, but it always has an "ok" field (which holds a return value of "lint" method) at least. stash Returns a reference to a hash that contains the details of analysis (stored in a stash in Module::CPANTS::Analyse). Internal structure may change without notice, but it always has a "kwalitee" field (which holds a reference to a hash that contains the result of each metric) at least. score Returns a Kwalitee score. output_report Writes a report to STDOUT (or to a file). report_file Returns a path to a report file, which should have the same distribution name with a version, plus an extension appropriate to the output format. (eg. "Foo-Bar-1.42.txt", "Foo-Bar-1.42.yml" etc) SEE ALSO Module::CPANTS::Analyse Test::Kwalitee AUTHOR Kenichi Ishigaki, COPYRIGHT AND LICENSE This software is copyright (c) 2014 by Kenichi Ishigaki. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. App-CPANTS-Lint-0.05/lib/0000755000175000017500000000000012446205117014762 5ustar ishigakiishigakiApp-CPANTS-Lint-0.05/lib/App/0000755000175000017500000000000012446205117015502 5ustar ishigakiishigakiApp-CPANTS-Lint-0.05/lib/App/CPANTS/0000755000175000017500000000000012446205117016472 5ustar ishigakiishigakiApp-CPANTS-Lint-0.05/lib/App/CPANTS/Lint.pm0000644000175000017500000002637212446204673017756 0ustar ishigakiishigakipackage App::CPANTS::Lint; use strict; use warnings; use Carp; use Module::CPANTS::Analyse; our $VERSION = '0.05'; sub new { my ($class, %opts) = @_; $opts{no_capture} = 1 if !defined $opts{no_capture}; $opts{dump} = 1 if $opts{yaml} || $opts{json}; if ($opts{metrics_path}) { Module::CPANTS::Analyse->import(@{$opts{metrics_path}}); } bless {opts => \%opts}, $class; } sub lint { my ($self, $dist) = @_; croak "Cannot find $dist" unless -f $dist; my $mca = $self->{mca} = Module::CPANTS::Analyse->new({ dist => $dist, opts => $self->{opts}, }); my $res = $self->{res} = {dist => $dist}; { if (-f $dist and my $error = $mca->unpack) { warn "$dist: $error\n" and last; } $mca->analyse; } $mca->calc_kwalitee; my $kwl = $mca->d->{kwalitee}; my %err = %{ $mca->d->{error} || {} }; my (%fails, %passes); for my $ind (@{$mca->mck->get_indicators}) { if ($ind->{needs_db}) { push @{$res->{ignored} ||= []}, $ind->{name}; next; } if ($mca->can('x_opts') && $mca->x_opts->{ignore}{$ind->{name}} && $ind->{ignorable}) { push @{$res->{ignored} ||= []}, $ind->{name}; next; } next if ($kwl->{$ind->{name}} || 0) > 0; my $type = $ind->{is_extra} ? 'extra' : $ind->{is_experimental} ? 'experimental' : 'core'; next if $type eq 'experimental' && !$self->{opts}{experimental}; my $error = $err{$ind->{name}}; if ($error && ref $error) { $error = $self->_dump($error); } push @{$fails{$type} ||= []}, { name => $ind->{name}, remedy => $ind->{remedy}, error => $error, }; } $res->{fails} = \%fails; $res->{score} = $self->score(1); return $res->{ok} = (!$fails{core} and (!$fails{extra} || $self->{opts}{core_only})) ? 1 : 0; } sub _dump { my ($self, $thingy, $pretty) = @_; if ($self->{opts}{yaml} && eval { require CPAN::Meta::YAML }) { return CPAN::Meta::YAML::Dump($thingy); } elsif ($self->{opts}{json} && eval { require JSON::PP }) { my $coder = JSON::PP->new->utf8; $coder->pretty if $pretty; return $coder->encode($thingy); } else { require Data::Dumper; my $dumper = Data::Dumper->new([$thingy])->Terse(1)->Sortkeys(1); $dumper->Indent(0) unless $pretty; $dumper->Dump; } } sub stash { shift->{mca}->d } sub result { shift->{res} } sub score { my ($self, $wants_detail) = @_; my $mca = $self->{mca}; my %fails = %{$self->{res}{fails} || {}}; my $max_core_kw = $mca->mck->available_kwalitee; my $max_kw = $mca->mck->total_kwalitee; my $total_kw = $max_kw - @{$fails{core} || []} - @{$fails{extra} || []}; my $score = sprintf "%.2f", 100 * $total_kw/$max_core_kw; if ($wants_detail) { $score .= "% ($total_kw/$max_core_kw)"; } $score; } sub report { my $self = shift; # shortcut if ($self->{opts}{dump}) { return $self->_dump($self->stash, 'pretty'); } elsif ($self->{opts}{colour} && $self->_supports_colour) { return $self->_colour; } my $res = $self->{res} || {}; my $report = "Checked dist: $res->{dist}\n" . "Score: $res->{score}\n"; if ($res->{ignored}) { $report .= "Ignored metrics: " . join(', ', @{$res->{ignored}}) . "\n"; } if ($res->{ok}) { $report .= "Congratulations for building a 'perfect' distribution!\n"; } for my $type (qw/core extra experimental/) { if (my $fails = $res->{fails}{$type}) { $report .= "\n" . "Failed $type Kwalitee metrics and\n" . "what you can do to solve them:\n\n"; for my $fail (@$fails) { $report .= "Name: $fail->{name}\n" . "Remedy: $fail->{remedy}\n"; if ($fail->{error}) { $report .= "Error: $fail->{error}\n"; } $report .= "\n"; } } } $report; } sub _supports_colour { my $self = shift; eval { require Term::ANSIColor; require Win32::Console::ANSI if $^O eq 'MSWin32'; 1 } } sub _colour_scheme { my $self = shift; my %scheme = ( heading => "bright_white", title => "blue", fail => "bright_red", pass => "bright_green", warn => "bright_yellow", error => "red", summary => "blue", ); if ($^O eq 'MSWin32') { $scheme{$_} =~ s/bright_// for keys %scheme; } \%scheme; } sub _colour { my ($self) = @_; my $scheme = $self->_colour_scheme; my $icon = $^O eq 'MSWin32' ? {pass => 'o', fail => 'x'} : {pass => "\x{2713}", fail => "\x{2717}"}; my $report = Term::ANSIColor::colored("Distribution: ", "bold $scheme->{heading}") . Term::ANSIColor::colored($self->result->{dist}, "bold $scheme->{title}") . "\n"; my %failed; for my $arr (values %{$self->result->{fails}}) { for my $fail (@$arr) { $failed{$fail->{name}} = $fail; } } my $core_fails = 0; for my $type (qw/ Core Optional Experimental /) { $report .= Term::ANSIColor::colored("\n$type\n", "bold $scheme->{heading}"); my @inds = $self->{mca}->mck->get_indicators(lc $type); my @fails; for my $ind (@inds) { if ($failed{ $ind->{name} }) { push @fails, $ind; $core_fails++ if $type eq 'Core'; $report .= Term::ANSIColor::colored(" $icon->{fail} ", $scheme->{fail}) . $ind->{name}; $report .= ": " . Term::ANSIColor::colored($failed{ $ind->{name} }{error}, $scheme->{error}) if $failed{ $ind->{name} }{error}; } else { $report .= Term::ANSIColor::colored(" $icon->{pass} ", $scheme->{pass}) . $ind->{name}; } $report .= "\n"; } for my $fail (@fails) { $report .= "\n" . Term::ANSIColor::colored("Name: ", "bold $scheme->{summary}") . Term::ANSIColor::colored("$fail->{name}\n", $scheme->{summary}) . Term::ANSIColor::colored("Remedy: ", "bold $scheme->{summary}") . Term::ANSIColor::colored("$fail->{remedy}\n", $scheme->{summary}); } } my $scorecolour = $scheme->{pass}; $scorecolour = $scheme->{warn} if keys %failed; $scorecolour = $scheme->{fail} if $core_fails; $report .= "\n" . Term::ANSIColor::colored("Score: ", "bold $scheme->{heading}") . Term::ANSIColor::colored($self->result->{score}, "bold $scorecolour") . "\n"; $report; } sub output_report { my $self = shift; if ($self->{opts}{save}) { my $file = $self->report_file; open my $fh, '>:utf8', $file or croak "Cannot write to $file: $!"; print $fh $self->report; } else { binmode(STDOUT, ':utf8'); print $self->report; } } sub report_file { my $self = shift; my $dir = $self->{opts}{dir} || '.'; my $vname = $self->{mca}->d->{vname}; if (!$vname) { require File::Basename; $vname = File::Basename::basename($self->{res}{dist}); } my $extension = $self->{opts}{yaml} ? '.yml' : $self->{opts}{json} ? '.json' : $self->{opts}{dump} ? '.dmp' : '.txt'; require File::Spec; File::Spec->catfile($dir, "$vname$extension"); } 1; __END__ =encoding utf-8 =head1 NAME App::CPANTS::Lint - front-end to Module::CPANTS::Analyse =head1 SYNOPSIS use App::CPANTS::Lint; my $app = App::CPANTS::Lint->new(verbose => 1); $app->lint('path/to/Foo-Dist-1.42.tgz') or print $app->report; # if you need raw data $app->lint('path/to/Foo-Dist-1.42.tgz') or return $app->result; # if you need to look at the details of analysis $app->lint('path/to/Foo-Dist-1.42.tgz'); print Data::Dumper::Dumper($app->stash); =head1 DESCRIPTION L is a core of C script to check the Kwalitee of a distribution. See the script for casual usage. You can also use this from other modules for finer control. =head1 METHODS =head2 new Takes an optional hash (which will be passed into L internally) and creates a linter object. Available options are: =over 4 =item verbose Makes L verbose. False by default. =item core_only If true, the C method (see below) returns true even if C metrics (as well as C metrics) fail. This may be useful if you only care Kwalitee rankings. False by default. =item experimental If true, failed C metrics are also reported (via C method). False by default. Note that C metrics are not taken into account while calculating a score. =item save If true, C method writes to a file instead of writing to STDOUT. =item dump, yaml, json If true, C method returns a formatted dump of the stash (see below). =item search_path If you'd like to use extra metrics modules, pass a reference to an array of their parent namespace(s) to search. Metrics modules under Module::CPANTS::Kwalitee namespace are always used. =back =head2 lint Takes a path to a distribution tarball and analyses it. Returns true if the distribution has no significant issues (experimental metrics are always ignored). Otherwise, returns false. Note that the result doesn't always match with what is shown at the CPANTS website, because there are metrics that are only available at the site for various reasons (some of them require database connection, and some are not portable enough). =head2 report Returns a report string that contains the details of failed metrics (even if C method returns true) and a Kwalitee score. If C (or C, C) is set when you create an App::CPANTS::Lint object, C returns a formatted dump of the stash. =head2 result Returns a reference to a hash that contains the details of failed metrics and a Kwalitee score. Internal structure may change without notice, but it always has an "ok" field (which holds a return value of C method) at least. =head2 stash Returns a reference to a hash that contains the details of analysis (stored in a stash in L). Internal structure may change without notice, but it always has a "kwalitee" field (which holds a reference to a hash that contains the result of each metric) at least. =head2 score Returns a Kwalitee score. =head2 output_report Writes a report to STDOUT (or to a file). =head2 report_file Returns a path to a report file, which should have the same distribution name with a version, plus an extension appropriate to the output format. (eg. C, C etc) =head1 SEE ALSO L L =head1 AUTHOR Kenichi Ishigaki, Eishigaki@cpan.orgE =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2014 by Kenichi Ishigaki. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut App-CPANTS-Lint-0.05/t/0000755000175000017500000000000012446205117014457 5ustar ishigakiishigakiApp-CPANTS-Lint-0.05/t/00_load.t0000644000175000017500000000011512446176071016065 0ustar ishigakiishigakiuse strict; use warnings; use Test::UseAllModules; BEGIN { all_uses_ok(); } App-CPANTS-Lint-0.05/META.json0000644000175000017500000000237512446205117015644 0ustar ishigakiishigaki{ "abstract" : "front-end to Module::CPANTS::Analyse", "author" : [ "Kenichi Ishigaki " ], "dynamic_config" : 0, "generated_by" : "ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.143240", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "App-CPANTS-Lint", "no_index" : { "directory" : [ "t", "inc" ] }, "prereqs" : { "build" : { "requires" : { "ExtUtils::MakeMaker" : "0", "Test::More" : "0.88", "Test::UseAllModules" : "0.10" } }, "configure" : { "requires" : { "ExtUtils::MakeMaker::CPANfile" : "0.06" } }, "runtime" : { "requires" : { "Carp" : "0", "Data::Dumper" : "0", "Getopt::Long" : "0", "Module::CPANTS::Analyse" : "0.96", "Pod::Usage" : "0", "perl" : "5.008001" } } }, "release_status" : "stable", "resources" : { "repository" : { "url" : "https://github.com/charsbar/App-CPANTS-Lint" } }, "version" : "0.05" } App-CPANTS-Lint-0.05/Changes0000644000175000017500000000072312446205020015502 0ustar ishigakiishigakiRevision history for App-CPANTS-Lint 0.05 2014/12/23 - Added metrics_path option to use extra metrics modules (such as modules under Module::CPANTS::SiteKwalitee::) - Fixed README 0.04 2014/07/14 - Added colo(u)r option (TOBYINK++) 0.03 2014/07/01 - Not to show experimental fails unless 'experimental' option is set (NEILB++) 0.02 2014/06/29 - Typo in pod (=open instead of =over) (NEILB++) 0.01 2014/06/29 - initial release App-CPANTS-Lint-0.05/Makefile.PL0000644000175000017500000000075112446176071016177 0ustar ishigakiishigakiuse strict; use warnings; use ExtUtils::MakeMaker::CPANfile; WriteMakefile( NAME => 'App::CPANTS::Lint', AUTHOR => 'Kenichi Ishigaki ', VERSION_FROM => 'lib/App/CPANTS/Lint.pm', ABSTRACT_FROM => 'lib/App/CPANTS/Lint.pm', LICENSE => 'perl', EXE_FILES => ['bin/cpants_lint.pl'], MIN_PERL_VERSION => '5.008001', META_MERGE => { resources => { repository => 'https://github.com/charsbar/App-CPANTS-Lint', }, }, ); App-CPANTS-Lint-0.05/META.yml0000644000175000017500000000135712446205117015473 0ustar ishigakiishigaki--- abstract: 'front-end to Module::CPANTS::Analyse' author: - 'Kenichi Ishigaki ' build_requires: ExtUtils::MakeMaker: '0' Test::More: '0.88' Test::UseAllModules: '0.10' configure_requires: ExtUtils::MakeMaker::CPANfile: '0.06' dynamic_config: 0 generated_by: 'ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.143240' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: App-CPANTS-Lint no_index: directory: - t - inc requires: Carp: '0' Data::Dumper: '0' Getopt::Long: '0' Module::CPANTS::Analyse: '0.96' Pod::Usage: '0' perl: '5.008001' resources: repository: https://github.com/charsbar/App-CPANTS-Lint version: '0.05' App-CPANTS-Lint-0.05/bin/0000755000175000017500000000000012446205117014764 5ustar ishigakiishigakiApp-CPANTS-Lint-0.05/bin/cpants_lint.pl0000644000175000017500000000540512446203666017652 0ustar ishigakiishigaki#!perl use strict; use warnings; use App::CPANTS::Lint; use Getopt::Long qw/:config gnu_compat/; use Pod::Usage; GetOptions(\my %opts, qw( help|? man verbose dump yaml json colour|color save|to_file dir=s metrics_path=s@ )); pod2usage(1) if $opts{help}; pod2usage(-exitstatus => 0, -verbose => 2) if $opts{man}; my $dist = shift @ARGV; pod2usage(-exitstatus => 0, -verbose => 0) unless $dist; my $app = App::CPANTS::Lint->new(%opts); my $res = $app->lint($dist); $app->output_report; __END__ =encoding utf-8 =head1 NAME cpants_lint.pl - commandline frontend to Module::CPANTS::Analyse =head1 SYNOPSIS cpants_lint.pl path/to/Foo-Dist-1.42.tgz Options: --help brief help message --man full documentation --verbose print more info during run --colour, --color pretty output --dump dump result using Data::Dumper --yaml dump result as YAML --json dump result as JSON --save write report (or dump) to a file --dir directory to save a report to --metrics_path search path for extra metrics modules =head1 DESCRIPTION C checks the B of a CPAN distribution. More exact, it checks how a given tarball will be rated on C, without needing to upload it first. For more information on Kwalitee, and the whole of CPANTS, see C and / or C. =head1 OPTIONS =head2 --help Print a brief help message. =head2 --man Print manpage. =head2 --verbose Print some informative messages while analysing a distribution. =head2 --colour, --color Like C<< --verbose >>, but prettier. You need to install L (and L for Win32) to enable this option. =head2 --dump Dump the result using Data::Dumper (instead of displaying a report text). =head2 --yaml Dump the result as YAML. =head2 --json Dump the result as JSON. =head3 --save Output the result into a file instead of STDOUT. The name of the file will be F (well, the extension depends on the dump format and can be C<.dmp>, C<.yml> or C<.json>) =head3 --dir Directory to dump a file to. Defaults to the current working directory. =head3 --metrics_path Search path for extra metrics modules =head1 AUTHOR L L =head1 COPYRIGHT AND LICENSE Copyright © 2003–2006, 2009 L Copyright © 2014 L You may use and distribute this module according to the same terms that Perl is distributed under. App-CPANTS-Lint-0.05/cpanfile0000644000175000017500000000040512446204660015721 0ustar ishigakiishigakirequires 'Carp'; requires 'Data::Dumper'; requires 'Getopt::Long'; requires 'Module::CPANTS::Analyse' => '0.96'; requires 'Pod::Usage'; on 'test' => sub { requires 'Test::More' => '0.88'; # for done_testing requires 'Test::UseAllModules' => '0.10'; }; App-CPANTS-Lint-0.05/MANIFEST0000644000175000017500000000054212446205117015346 0ustar ishigakiishigakibin/cpants_lint.pl Changes cpanfile lib/App/CPANTS/Lint.pm LICENSE Makefile.PL MANIFEST This list of files README t/00_load.t xt/10_basic.t xt/99_pmv.t xt/99_pod.t xt/99_podcoverage.t META.yml Module YAML meta-data (added by MakeMaker) META.json Module JSON meta-data (added by MakeMaker) App-CPANTS-Lint-0.05/LICENSE0000644000175000017500000004423612446176071015240 0ustar ishigakiishigakiThis software is copyright (c) 2014 by Kenichi Ishigaki. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Terms of the Perl programming language system itself a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the "Artistic License" --- The GNU General Public License, Version 1, February 1989 --- This software is Copyright (c) 2014 by Kenichi Ishigaki. This is free software, licensed under: The GNU General Public License, Version 1, February 1989 GNU GENERAL PUBLIC LICENSE Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. The General Public License applies to the Free Software Foundation's software and to any other program whose authors commit to using it. You can use it for your programs, too. When we speak of free software, we are referring to freedom, not price. Specifically, the General Public License is designed to make sure that you have the freedom to give away or sell copies of free software, that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of a such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any work containing the Program or a portion of it, either verbatim or with modifications. Each licensee is addressed as "you". 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this General Public License and to the absence of any warranty; and give any other recipients of the Program a copy of this General Public License along with the Program. You may charge a fee for the physical act of transferring a copy. 2. You may modify your copy or copies of the Program or any portion of it, and copy and distribute such modifications under the terms of Paragraph 1 above, provided that you also do the following: a) cause the modified files to carry prominent notices stating that you changed the files and the date of any change; and b) cause the whole of any work that you distribute or publish, that in whole or in part contains the Program or any part thereof, either with or without modifications, to be licensed at no charge to all third parties under the terms of this General Public License (except that you may choose to grant warranty protection to some or all third parties, at your option). c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the simplest and most usual way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this General Public License. d) You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. Mere aggregation of another independent work with the Program (or its derivative) on a volume of a storage or distribution medium does not bring the other work under the scope of these terms. 3. You may copy and distribute the Program (or a portion or derivative of it, under Paragraph 2) in object code or executable form under the terms of Paragraphs 1 and 2 above provided that you also do one of the following: a) accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Paragraphs 1 and 2 above; or, b) accompany it with a written offer, valid for at least three years, to give any third party free (except for a nominal charge for the cost of distribution) a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Paragraphs 1 and 2 above; or, c) accompany it with the information you received as to where the corresponding source code may be obtained. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form alone.) Source code for a work means the preferred form of the work for making modifications to it. For an executable file, complete source code means all the source code for all modules it contains; but, as a special exception, it need not include source code for modules which are standard libraries that accompany the operating system on which the executable file runs, or for standard header files or definitions files that accompany that operating system. 4. You may not copy, modify, sublicense, distribute or transfer the Program except as expressly provided under this General Public License. Any attempt otherwise to copy, modify, sublicense, distribute or transfer the Program is void, and will automatically terminate your rights to use the Program under this License. However, parties who have received copies, or rights to use copies, from you under this General Public License will not have their licenses terminated so long as such parties remain in full compliance. 5. By copying, distributing or modifying the Program (or any work based on the Program) you indicate your acceptance of this license to do so, and all its terms and conditions. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. 7. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of the license which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the license, you may choose any version ever published by the Free Software Foundation. 8. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to humanity, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the program's name and a brief idea of what it does.> Copyright (C) 19yy <name of author> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19xx name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (a program to direct compilers to make passes at assemblers) written by James Hacker. <signature of Ty Coon>, 1 April 1989 Ty Coon, President of Vice That's all there is to it! --- The Artistic License 1.0 --- This software is Copyright (c) 2014 by Kenichi Ishigaki. This is free software, licensed under: The Artistic License 1.0 The Artistic License Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Definitions: - "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. - "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder. - "Copyright Holder" is whoever is named in the copyright or copyrights for the package. - "You" is you, if you're thinking about copying or distributing this Package. - "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) - "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as ftp.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) accompany any non-standard executables with their corresponding Standard Version executables, giving the non-standard executables non-standard names, and clearly documenting the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. 5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. 6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whomever generated them, and may be sold commercially, and may be aggregated with this Package. 7. C or perl subroutines supplied by you and linked into this Package shall not be considered part of this Package. 8. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End App-CPANTS-Lint-0.05/xt/0000755000175000017500000000000012446205117014647 5ustar ishigakiishigakiApp-CPANTS-Lint-0.05/xt/99_pod.t0000644000175000017500000000034512446176071016147 0ustar ishigakiishigakiuse strict; use warnings; use Test::More; eval "use Test::Pod 1.18"; plan skip_all => 'Test::Pod 1.18 required' if $@; plan skip_all => 'set RELEASE_TESTING to enable this test' unless $ENV{RELEASE_TESTING}; all_pod_files_ok(); App-CPANTS-Lint-0.05/xt/99_pmv.t0000644000175000017500000000012612446176071016164 0ustar ishigakiishigakiuse strict; use warnings; use Test::MinimumVersion; all_minimum_version_ok('5.008'); App-CPANTS-Lint-0.05/xt/99_podcoverage.t0000644000175000017500000000037512446176071017666 0ustar ishigakiishigakiuse strict; use warnings; use Test::More; eval "use Test::Pod::Coverage 1.04"; plan skip_all => 'Test::Pod::Coverage 1.04 required' if $@; plan skip_all => 'set RELEASE_TESTING to enable this test' unless $ENV{RELEASE_TESTING}; all_pod_coverage_ok(); App-CPANTS-Lint-0.05/xt/10_basic.t0000644000175000017500000000225712446176071016431 0ustar ishigakiishigakiuse strict; use warnings; use FindBin; use File::Path; use Test::More; use App::CPANTS::Lint; eval { require WorePAN; WorePAN->import("0.09"); 1; } or plan skip_all => "requires WorePAN 0.09 to test"; my @dists = ( # should pass as of Module::CPANTS::Analyse 0.92 'NEILB/Exporter-Lite-0.05.tar.gz', # should fail 'ISHIGAKI/Acme-CPANAuthors-0.23.tar.gz', ); my $testdir = "$FindBin::Bin/worepan"; mkpath $testdir unless -d $testdir; for my $experimental (0..1) { my $app = App::CPANTS::Lint->new(experimental => $experimental); for my $dist (@dists) { test($app, $dist); } } rmtree $testdir if -d $testdir; done_testing; sub test { my ($app, $dist) = @_; my $worepan = WorePAN->new( root => $testdir, files => [$dist], use_backpan => 1, no_network => 0, cleanup => 1, no_indices => 1, verbose => 0, ); my $file = $worepan->file($dist); ok -f $file; my $got = $app->lint($file); if ($got) { diag "Lint ok: $dist"; like $app->report => qr/Congratulations/; note $app->report; } else { diag "Lint fail: $dist"; like $app->report => qr/Failed (?:core|extra) Kwalitee metrics/; note $app->report; } }