App::C...S::Lint(3pm)
β¨ App::CPANTS::Lint β the NAME section, but make it cute β¨
okay so bestie, this is App::CPANTS::Lint, and it's basically the front-end to Module::CPANTS::Analyse. that's the whole vibe. π
It's a User Contributed Perl Documentation page, so you know it's real. π«Ά
πΈ SYNOPSIS πΈ
here's how you actually use it, no cap:
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);
literally that's it. three whole modes of existence. β¨
π DESCRIPTION π
so App::CPANTS::Lint is the core of the cpants_lint.pl script β its whole job is checking the Kwalitee of a distribution. if you just wanna casually use it, go look at the script itself, it's giving convenience. but if you're the kind of girl who needs finer control, you can call this from other modules too. main character energy fr fr. π
π METHODS π
new
Takes an optional hash β and bestie, that hash gets passed into Module::CPANTS::Analyse internally β and creates a linter object for you. iconic. π
The available options are, and I cannot stress this enough, all of them:
verboseβ makesModule::CPANTS::Analyseverbose. False by default. (yes, the default is silence. mysterious. love that for us.)core_onlyβ if true, thelintmethod (scroll down, it's right there) returns true even ifextrametrics fail, andexperimentalmetrics too. lowkey useful if all you care about is Kwalitee rankings. False by default.experimentalβ if true, failedexperimentalmetrics also get reported (via thereportmethod). False by default. β οΈ heads up though:experimentalmetrics are not taken into account while calculating a score. so they're just there. existing. being extra. πsaveβ if true, theoutput_reportmethod writes to a file instead of writing toSTDOUT.dump,yaml,jsonβ if true, thereportmethod returns a formatted dump of the stash (see below). three little format gremlins, pick your fighter. πsearch_pathβ if you'd like to use extra metrics modules, pass a reference to an array of their parent namespace(s) to search. and ngl, metrics modules under theModule::CPANTS::Kwaliteenamespace are always used, no opt-out, that's just the law. π
lint
Takes a path to a distribution tarball and analyses it. Returns true if the distribution has no significant issues β and note that experimental metrics are always ignored here, periodt. Otherwise? Returns false. π
β οΈ real talk: the result doesn't always match what's shown at the CPANTS website, because there are metrics that are only available at the site for various reasons. some of them require a database connection, and some are just not portable enough. so don't come for me if the numbers disagree, it's giving "it's complicated". π
report
Returns a report string that contains the details of failed metrics (yes, even if the lint method returns true, it still tells you) plus a Kwalitee score. π
And if dump (or yaml, or json) was set when you created your App::CPANTS::Lint object, then report returns a formatted dump of the stash instead. plot twist. β¨
result
Returns a reference to a hash that contains the details of failed metrics and a Kwalitee score. β οΈ the internal structure may change without notice, but it always has an ok field (which holds a return value of the lint method) at least. so grab that ok and don't get too attached to anything else, bestie. π
stash
Returns a reference to a hash that contains the details of analysis (stored in a stash in Module::CPANTS::Analyse). β οΈ same warning, same energy: the internal structure may change without notice, but it always has a kwalitee field (which holds a reference to a hash containing the result of each metric) at least. one guaranteed field, zero promises about the rest. π¦
score
Returns a Kwalitee score. that's it. that's the whole method. slay. β
output_report
Writes a report to STDOUT (or to a file, if you told it to). simple. clean. we love her. π
report_file
Returns a path to a report file. and the naming scheme? the file should have the same distribution name with a version, plus an extension appropriate to the output format. so like:
Foo-Bar-1.42.txtFoo-Bar-1.42.yml
etc. consistent naming is self-care, iykyk. πΈ
π SEE ALSO π
Module::CPANTS::AnalyseTest::Kwalitee
go read them, they're the supporting cast and they ate. π₯
βοΈ AUTHOR βοΈ
Kenichi Ishigaki, <ishigaki@cpan.org> β absolute legend, we stan. π
π 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. π«Ά
okay that's the whole page bestie, you're so ready. this lil doc came to you courtesy of perl v5.34.0, dated 2022-06-08, and the manual name it lives under is App::C...S::Lint(3pm) β now go lint something and make it iconic. π
β¨ππ¦
π¦ where this page comes from
- debian bookworm: libapp-cpants-lint-perl 0.05-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libapp-cpants-lint-perl 0.05-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libapp-cpants-lint-perl 0.05-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms