peckphp/peck
Peck is a fast CLI spell-checker for your codebase—filenames, class/method/property names, docs, and more. Powered by GNU Aspell, it helps catch wording and spelling mistakes and fits neatly into workflows like Pint or Pest. Requires PHP 8.2+ and Aspell.
Peck is a standalone CLI tool with no native Laravel integration (e.g., service providers, config files, or event hooks). It operates as a pre-commit or CI-level check, similar to PHPStan or Pest, rather than a core framework component. Its focus on spelling/grammar in code comments, strings, and documentation aligns well with Laravel’s emphasis on maintainable, user-facing code (e.g., error messages, validation rules, or API responses). However, it lacks:
laravel preset (e.g., no built-in support for Blade templates, Eloquent model naming conventions, or Artisan command terminology).userId).peckphp/peck) and runs as a binary (./vendor/bin/peck). No Laravel-specific dependencies exist, but it requires GNU Aspell (a system-level dependency), which may complicate cross-environment consistency (e.g., CI vs. local dev).peck.json file supports project-specific ignores (e.g., Laravel’s config(), route(), or DB:: terms), but requires manual setup. No Laravel config publisher or config/peck.php integration exists.Illuminate, ServiceProvider, Route::get) may trigger false positives unless explicitly ignored.--path to limit scope or .gitignore-style exclusions in peck.json.peck.json).peck.json ignores? (e.g., a shared config repo or per-project files).Livewire, Jetstream) be added to the preset?Peck is agnostic to Laravel’s stack but integrates via:
--dev flag recommended)../vendor/bin/peck), compatible with Laravel’s existing toolchain (e.g., Artisan, composer scripts).peck.json (YAML/JSON), which can coexist with Laravel’s config/ files but requires manual sync.Best Fit For:
.php docblocks).Misalignment:
composer require --dev peckphp/peck).--init to generate peck.json and review false positives.if [ "$CI" = "true" ]; then ./vendor/bin/peck --quiet; fi).laravel preset in peck.json to ignore Laravel terms:
{
"preset": "laravel",
"ignore": {
"words": ["Illuminate", "ServiceProvider", "route", "DB::", "config()"],
"paths": ["resources/views", "tests"]
}
}
// @peck-skip in Blade files).composer.json scripts:
"scripts": {
"lint:peck": "peck --report=checkstyle > build/peck-report.xml",
"test": ["lint:peck", "@phpunit"]
}
- name: Peck Spellcheck
run: composer lint:peck
0).| Component | Compatibility | Mitigation |
|---|---|---|
| PHP Version | Requires 8.2+ (Laravel 9+). | Upgrade PHP or use a polyfill (high risk). |
| OS Dependencies | GNU Aspell must be installed (Linux/macOS/WSL). | Document setup in CONTRIBUTING.md. |
| Laravel Features | No native support for Blade, Eloquent, or Artisan commands. | Manually ignore paths (e.g., app/Console). |
| CI Systems | Works with GitHub Actions, GitLab CI, and self-hosted runners. | Add OS-specific Aspell install steps. |
| IDE Tools | No VS Code/Laravel IDE Helper integration. | Use CLI or third-party plugins. |
husky).peck.json as new Laravel terms emerge.peck.json requires ongoing curation as the codebase evolves (e.g., new Laravel features, custom terminology). Solution: Shared config repo or team-owned ignores.peck.json or inline comments).userId vs. userid).--path or `.gitHow can I help you explore Laravel packages today?