Peck is a powerful CLI tool designed to identify wording or spelling mistakes in your codebase: filenames, class names, method names, property names, docs, and more. Built for speed, simplicity, and seamless integration, Peck fits naturally into your workflow, much like tools such as Pint or Pest.
Leveraging the robust capabilities of GNU Aspell, Peck inspects every corner of your codebase — ensuring your work maintains a high standard of clarity and professionalism.
Note: Peck is still under active development and is not yet ready for production use.
Requires PHP 8.3+ and GNU Aspell
Peck relies on GNU Aspell for its spell-checking functionality. Make sure GNU Aspell is installed on your system before using Peck.
- If you are using Debian/Ubuntu:
sudo apt-get install aspell aspell-en
- If you are using MacOS (using Homebrew):
brew install aspell
- If you are using Windows::
Move to the WSL (Windows Subsystem for Linux) and install GNU Aspell using the following command:
sudo apt-get install aspell aspell-en
You can require Peck using Composer with the following command:
composer require peckphp/peck --dev
./vendor/bin/peck --init
To check your project for spelling mistakes, run:
./vendor/bin/peck
Peck can be configured using a peck.json
file in the root of your project.
You can scaffold the peck.json
file with:
./vendor/bin/peck --init
Here's an example configuration:
{
"ignore": {
"words": [
"config",
"namespace"
],
"directories": [
"app/MyNamespace"
]
}
}
You can also specify the path to the configuration file using the --config
option:
./vendor/bin/peck --config relative/path/to/peck.json
The behaviour of peck
can be modified with the following command options:
If you don't have a peck.json
file yet, you can create a blank configuration file by using the --init
option.
By default peck
will check for a peck.json
file in your project root. If one isn't available it will try to figure out the directory to check by itself.
The path to check can be overwritten with the --path
option. If the path is one you always need checking you can place it in your peck.json
file.
When running Peck on GitHub Actions, you can use the following workflow before running Peck:
- name: Install Aspell
shell: bash
run: |
if [[ "$RUNNER_OS" == "Linux" ]]; then
sudo apt-get update && sudo apt-get install -y aspell aspell-en
elif [[ "$RUNNER_OS" == "macOS" ]]; then
brew install aspell
fi
Peck is an open-sourced software licensed under the MIT license.