NAME

App::genstopwords - Generate a .stopwords file for POD spell-checking

VERSION

Version v0.0.1

SYNOPSIS

gen-stopwords [OPTIONS]

# Basic usage (scans current directory, writes .stopwords)
gen-stopwords

# Specify language and output file
gen-stopwords --lang en_US --output t/.stopwords

# Scan specific directories
gen-stopwords --dir lib --dir bin --dir t

# Preview without writing
gen-stopwords --dry-run --verbose

# Show this help
gen-stopwords --help

DESCRIPTION

Scans Perl source files (.pm, .pl, .pod, .t) and uses aspell to identify words that are not in the standard dictionary. Those words are collected into a .stopwords file that your spelling test (e.g. Test::Spelling) can use to suppress false positives.

The generator:

  • Strips POD formatting codes (>, ..., ..., etc.) before passing lines to aspell, preventing artefacts like Egt.

  • Uses --run-together so compound identifiers such as ResultSet and PendingChange are handled correctly.

  • Optionally seeds the list from your personal aspell wordlist (~/.aspell.en.pws) so project-specific words already known to you are included automatically.

  • Skips build/vendor directories (.git, blib, local, etc.) to keep the output clean.

OPTIONS

-l, --lang LANG

Aspell language code to use. Defaults to en_GB.

-o, --output FILE

Path of the stopwords file to write. Defaults to .stopwords in the current directory.

-p, --pws FILE

Path to your personal aspell wordlist. Defaults to ~/.aspell.en.pws. Use --no-global to skip this entirely.

-d, --dir DIR

Directory to scan. May be specified multiple times. Defaults to . (current directory).

-m, --min-len N

Minimum word length to include. Defaults to 2.

-v, --verbose

Print the name of every file processed and extra detail.

-q, --quiet

Suppress all non-error output.

-n, --dry-run

Show what would be written without actually creating or modifying the output file.

--no-global

Do not load words from the personal aspell wordlist.

-V, --version

Print the version and exit.

-h, --help

Print this help message and exit.

REQUIREMENTS

  • Perl 5.10+

  • aspell must be installed and on $PATH.

EXIT STATUS

Exits 0 on success, 1 on usage error, and dies with a descriptive message on fatal errors (missing aspell, unwritable output, etc.).

WORKFLOW

# 1. Generate (or regenerate after editing source files)
gen-stopwords

# 2. Run your spelling test
AUTHOR_TESTING=1 perl spelling.t

Your spelling test should warn you when source files are newer than .stopwords, prompting you to re-run this script.

AUTHOR

Mohammad Sajid Anwar, <mohammad.anwar at yahoo.com>

REPOSITORY

https://github.com/manwar/App-genstopwords

BUGS

Please report any bugs or feature requests through the web interface at https://github.com/manwar/App-genstopwords/issues. I will be notified and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc App::genstopwords

You can also look for information at:

LICENSE AND COPYRIGHT

Copyright (C) 2026 Mohammad Sajid Anwar.

This program is free software; you can redistribute it and / or modify it under the terms of the the Artistic License (2.0). You may obtain a copy of the full license at:

http://www.perlfoundation.org/artistic_license_2_0

Any use, modification, and distribution of the Standard or Modified Versions is governed by this Artistic License.By using, modifying or distributing the Package, you accept this license. Do not use, modify, or distribute the Package, if you do not accept this license. If your Modified Version has been derived from a Modified Version made by someone other than you,you are nevertheless required to ensure that your Modified Version complies with the requirements of this license. This license does not grant you the right to use any trademark, service mark, tradename, or logo of the Copyright Holder. This license includes the non-exclusive, worldwide, free-of-charge patent license to make, have made, use, offer to sell, sell, import and otherwise transfer the Package with respect to any patent claims licensable by the Copyright Holder that are necessarily infringed by the Package. If you institute patent litigation (including a cross-claim or counterclaim) against any party alleging that the Package constitutes direct or contributory patent infringement,then this Artistic License to you shall terminate on the date that such litigation is filed. Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.