Dist::Zilla::Plugin::Test::Perl::Critic::Subset - Tests to check your code against best practices
version 3.001.005
In your dist.ini:
[Test::Perl::Critic] critic_config = perlcritic.rc ; default / relative to project root ; to add some files/dirs ;file = t/mytest.t ;file = t/myothertest.t ;dir = xt ; to exclude some files/dirs by regex skip = todo skip = lib/Bencher/ScenarioR/ ; you can also specify finders to include/exclude files ;finder = :TestFiles ;finder = :InstallModules
Another example of specifying finders, by defining a custom finder (see Dist::Zilla::Plugin::FileFinder::ByName for more details):
[FileFinder::ByName / MyFiles] dir = lib dir = script file = *.t skip = lib/Bencher/ScenarioR/ [Test::Perl::Critic] finder = MyFiles
Fork notice: This is a temporary fork of Dist::Zilla::Plugin::Test::Perl::Critic 3.001 which includes https://github.com/perlancar/operl-Dist-Zilla-Plugin-Test-Perl-Critic/commit/bd46961d9d7da767f7a431fba13de441db4b6848 to add finder and files configuration options. These options let you select, include, exclude files to be tested.
finder
files
This will provide a xt/author/critic.t file for use during the "test" and "release" calls of dzil. To use this, make the changes to dist.ini above and run one of the following:
dzil
dzil test dzil release
During these runs, xt/author/critic.t will use Test::Perl::Critic to run Perl::Critic against your code and by report findings.
This plugin accepts the critic_config option, which specifies your own config file for Perl::Critic. It defaults to perlcritic.rc, relative to the project root. If the file does not exist, Perl::Critic will use its defaults.
critic_config
perlcritic.rc
This plugin is an extension of Dist::Zilla::Plugin::InlineFiles.
Specify a perl critic profile. Will be passed to Test::Perl::Critic's -profile import option.
-profile
This is the name of a FileFinder for finding files to check. The default value is :InstallModules, :ExecFiles, :TestFiles (see also Dist::Zilla::Plugin::ExecDir); this option can be used more than once.
:InstallModules
:ExecFiles
:TestFiles
Other predefined finders are listed in default_finders in Dist::Zilla::Role::FileFinderUser. You can define your own with the Dist::Zilla::Plugin::FileFinder::ByName plugin.
default_finders
A filename to also test, in addition to any files found earlier. This option can be repeated to specify multiple additional files.
perlancar <perlancar@cpan.org>
This software is copyright (c) 2020, 2019 by perlancar@cpan.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Dist::Zilla::Plugin::Test::Perl::Critic::Subset, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dist::Zilla::Plugin::Test::Perl::Critic::Subset
CPAN shell
perl -MCPAN -e shell install Dist::Zilla::Plugin::Test::Perl::Critic::Subset
For more information on module installation, please visit the detailed CPAN module installation guide.