NAME
Test::SpellCheck::Plugin::Perl - Test::SpellCheck plugin for checking spelling in Perl source
VERSION
version 0.02
SYNOPSIS
In Perl:
# these are the default values for all options.
spell_check ['Perl',
lang => 'en-us',
skip_sections => ['contributors', 'author', 'copyright and license'],
check_comments => 1,
];
In spellcheck.ini:
[Perl]
lang = en-us
skip_sections = contributors
skip_sections = author
skip_sections = copyright and license
check_comments = 1
DESCRIPTION
This plugin is a Combo plugin that provides reasonable defaults for checking spelling of most Perl distributions. It is also the default plugin used when you do not otherwise provide one. It roughly combines these plugins:
- Lang::EN::US
-
Although a different primary dictionary can be specified with the
lang
option. - PerlWords
-
Add Perl jargon like "autovivify" and
gethostbyaddr
. - PerlPOD
-
For checking POD for spelling errors.
- PerlPOD
-
For checking Perl comments for spelling errors. The use of this plugin can be turned off with the
check_comments
option below.
OPTIONS
skip_sections
This is a list of POD sections that you do not want to check for spelling errors. Note that the section titles will still be checked, just not the content. This is most useful for skipping "author" and "copyright and license" sections which frequently are and contain a lot of names.
lang
This allows using a different human language dictionary for your test. It can be either a string of the form xx-yy
where xx
and yy
are respectively the language and country code. This only works if there is already a plugin that provides that dictionary, like Test::SpellCheck::Plugin::Lang::EN::US.
spell_check ['Perl', lang => ['/foo/bar/baz.aff', '/foo/bar/baz.dic']];
Or in spellcheck.ini
:
[Perl]
lang = /foo/bar/baz.aff
lang = /foo/bar/baz.dic
You can also specify a pair of files to use, if there is no plugin, or you prefer to specify the path to the dictionary files.
check_comments
By default non-POD comments are checked for spelling errors. If you prefer not to check comments you can set this to a false value.
CONSTRUCTOR
new
my $plugin = Test::SpellCheck::Plugin::Perl->new(%options);
This creates a new instance of the plugin. Any of the options documented above can be passed into the constructor.
SEE ALSO
AUTHOR
Graham Ollis <plicease@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2021-2024 by Graham Ollis.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.