1Perl::Critic::Policy::DUosceurmeCPnoetnratltr:ii:obCnur:ti:etPdiocdP:Se:prPelolllDiiocncygu:(m:3eD)notcautmieonntation::PodSpelling(3)
2
3
4

Test The Spell Command

NAME

7       Perl::Critic::Policy::Documentation::PodSpelling - Check your spelling.
8

AFFILIATION

10       This Policy is part of the core Perl::Critic distribution.
11

DESCRIPTION

13       Did you write the documentation?  Check.
14
15       Did you document all of the public methods?  Check.
16
17       Is your documentation readable?  Hmm...
18
19       Ideally, we'd like Perl::Critic to tell you when your documentation is
20       inadequate.  That's hard to code, though.  So, inspired by
21       Test::Spelling, this module checks the spelling of your POD.  It does
22       this by pulling the prose out of the code and passing it to an external
23       spell checker.  It skips over words you flagged to ignore.  If the
24       spell checker returns any misspelled words, this policy emits a
25       violation.
26
27       If anything else goes wrong -- we can't locate the spell checking
28       program or (gasp!) your module has no POD -- then this policy passes.
29
30       To add exceptions on a module-by-module basis, add "stopwords" as
31       described in Pod::Spell.  For example:
32
33           =for stopword gibbles
34
35           =head1 Gibble::Manip -- manipulate your gibbles
36
37           =cut
38

CONFIGURATION

40       This policy can be configured to tell which spell checker to use or to
41       set a global list of spelling exceptions.  To do this, put entries in a
42       .perlcriticrc file like this:
43
44           [Documentation::PodSpelling]
45           spell_command = aspell list
46           stop_words = gibbles foobar
47           stop_words_file = some/path/with/stop/words.txt
48
49       The default spell command is "aspell list" and it is interpreted as a
50       shell command.  We parse the individual arguments via Text::ParseWords
51       so feel free to use quotes around your arguments.  If the executable
52       path is an absolute file name, it is used as-is.  If it is a relative
53       file name, we employ File::Which to convert it to an absolute path via
54       the "PATH" environment variable.  As described in Pod::Spell and
55       Test::Spelling, the spell checker must accept text on STDIN and print
56       misspelled words one per line on STDOUT.
57
58       You can specify global stop words via the "stop_words" and
59       "stop_words_file" options.  The former is simply split up on
60       whitespace.  The latter is looked at line by line, with anything after
61       an octothorp ("#") removed and then leading and trailing whitespace
62       removed.  Silly example valid file contents:
63
64           # It's a comment!
65
66           foo
67           arglbargl    # Some other comment.
68           bar
69
70       The values from "stop_words" and "stop_words_file" are merged together
71       into a single list of exemptions.
72

NOTES

74       A spell checking program is not included with Perl::Critic.
75
76       The results of failures for this policy can be confusing when aspell
77       complains about words containing punctuation such as hyphens and
78       apostrophes.  In this situation aspell will often only emit part of the
79       word that it thinks is misspelled.  For example, if you ask aspell to
80       check "foobie-bletch", the output only complains about "foobie".
81       Unfortunately, you'll have to look through your POD to figure out what
82       the real word that aspell is complaining about is.  One thing to try is
83       looking at the output of "perl -MPod::Spell -e 'print
84       Pod::Spell->new()->parse_from_file("lib/Your/Module.pm")'" to see what
85       is actually being checked for spelling.
86

PREREQUISITES

88       This policy will disable itself if File::Which is not available.
89

CREDITS

91       Initial development of this policy was supported by a grant from the
92       Perl Foundation.
93

AUTHOR

95       Chris Dolan <cdolan@cpan.org>
96
98       Copyright (c) 2007-2011 Chris Dolan.  Many rights reserved.
99
100       This program is free software; you can redistribute it and/or modify it
101       under the same terms as Perl itself.  The full text of this license can
102       be found in the LICENSE file included with this module
103
104
105
106perl v5.16.3               Perl::C2r0i1t4i-c0:6:-P0o9licy::Documentation::PodSpelling(3)
Impressum