Peck

Peck stats

Downloads
69
Stars
160
Open Issues
11
Forks
41

View on GitHub →

Peck is a CLI tool that detects wording / or spelling mistakes in your codebase.

Peck example

GitHub Workflow Status (master) Total Downloads Latest Version License


Peck is a powerful CLI tool designed to identify wording or spelling mistakes in your codebase. 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 via the github.com/tigitz/php-spellchecker PHP wrapper, Peck inspects every corner of your codebase — including folder names, file names, method names, comments, and beyond — 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. Currently, only the filesystem checker is implemented, focusing exclusively on detecting spelling mistakes in file and folder names.

Installation

Requires PHP 8.3+ and GNU Aspell

Peck relies on GNU Aspell for its spell-checking functionality. Make sure Aspell is installed on your system before using Peck.

Installing GNU Aspell

  • Debian/Ubuntu:

    sudo apt-get install aspell aspell-en
  • MacOS (using Homebrew):

    brew install aspell
  • Windows:\

    Move to WSL / WSL2, an use the following command: sudo apt-get install aspell aspell-en

    If you are using native shells like powershell, etc, please lease refer to the Aspell website for installation instructions.

Installing Peck

You can require Peck using Composer with the following command:

composer require peckphp/peck --dev

Usage

To check your project for spelling mistakes, run:

./vendor/bin/peck

Command Options

The behaviour of peck can be modified with the following options:

--config

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.

--path

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.

--init

If you don't have a peck.json file yet, you can create a blank configuration file by using the --init option.

Configuration

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

Running Peck on GitHub Actions

When running Peck on GitHub Actions, you can use the following workflow or something similar:

- 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.

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.


Peckphp Peck Related Articles

PeckPHP - A CLI tool designed to identify wording or spelling mistakes in your codebase image

PeckPHP - A CLI tool designed to identify wording or spelling mistakes in your codebase

Read article
Tighten logo

Tighten

We help companies turn great ideas into amazing apps, products, and services.

Tighten
No Compromises logo

No Compromises

Joel and Aaron, the two seasoned devs from the No Compromises podcast, are now available to hire for your Laravel project. ⬧ Flat rate of $9500/mo. ⬧ No lengthy sales process. ⬧ No contracts. ⬧ 100% money back guarantee.

No Compromises
Statamic logo

Statamic

The drop-in ready Laravel CMS you’re been waiting for. Go full-stack or headless, flat file or database – it’s up to you.

Statamic
Laravel Cloud logo

Laravel Cloud

Easily create and manage your servers and deploy your Laravel applications in seconds.

Laravel Cloud
Securing Laravel logo

Securing Laravel

The essential security resource for Laravel devs, covering everything you need to keep your apps secure. Sign up to receive weekly security tips and monthly in depth articles, diving deep into security concepts you need to know!

Securing Laravel
LoadForge logo

LoadForge

Scalable load testing for web apps & APIs. Simulate real-world traffic and identify breaking points and performance limits with powerful, scalable load tests designed for Laravel.

LoadForge