2

私がこのダミーのPerlパッケージを持っているとしましょうtest.pm

package test;

use strict;
use warnings;

=head1 DESCRIPTION

=head2 env

Return the environment name.

=cut

sub env { return "environment name"; }

=head2 hst

Return the history file name.

=cut

sub hst { return "history file"; }

=head2 hst_dir

Return the directory containing the history file.

=cut

sub hst_dir { return "history directory"; }

1;

Test::Spelling次に、コマンドラインから...を使用してスペルチェックを実行します。

$ perl -MTest::More -MTest::Spelling \
> -e 'pod_file_spelling_ok("test.pm", "spell check"); done_testing;'

...、および私の関数名envhstはタイプミスとしてマークされていますが、hst_dir受け入れられます:

not ok 1 - spell check
#   Failed test 'spell check'
#   at -e line 1.
# Errors:
#     env
#     hst
1..1
# Looks like you failed 1 test of 1.

カスタム辞書をでリストできることは知っていますadd_stopwords()が、私の意見では、関数名のスペルチェックはまったく行わないでください。

ドキュメントの細かい部分を見逃しましたか?

4

1 に答える 1

4

あなたはあなたのコードではなく、あなたのPODを呪文で嘲笑しています。

Test::Spelling見る:

=head2 env
=head2 hst

それが関数名であることをどうやって知ることができますか(関数名の概念をまったく知らないということではありません)?

アンダースコアがあるため、hst_dirはperlishキーワードと見なされますが、whixhは単語の通常の文字ではありません。しかし、それはストップワードなしで得られる最高のものです...

于 2012-09-26T10:27:44.770 に答える