Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Peck Laravel Package

peckphp/peck

Peck is a fast PHP CLI that spell-checks your codebase—filenames, classes, methods, properties, docs, and more—using GNU Aspell. Built to fit naturally into your workflow like Pint or Pest. Requires PHP 8.2+ and Aspell.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

Peck’s CLI-based, lexicon-focused design integrates seamlessly with Laravel’s developer-centric toolchain (e.g., Artisan, Composer, CI/CD pipelines). It operates at the code readability layer, addressing gaps left by static analyzers (PHPStan) or formatters (Pint) by targeting naming conventions, documentation, and textual consistency. The tool’s reliance on GNU Aspell for spell-checking is a strength, leveraging a battle-tested NLP library, but introduces a system-level dependency that may require additional infrastructure (e.g., Docker, WSL for Windows).

Key Synergies:

  • Laravel Preset: Out-of-the-box support for Laravel’s naming conventions (e.g., snake_case for migrations, PascalCase for classes) reduces configuration overhead.
  • Composer Integration: Installs as a dev dependency, aligning with Laravel’s modular tooling philosophy (e.g., Pest, Laravel Pint).
  • Non-Invasive: Operates on files without modifying them, making it safe for pre-commit hooks or CI gates.

Potential Frictions:

  • Laravel-Specific Edge Cases: Custom naming patterns (e.g., domain-specific acronyms, Blade template conventions) may require manual overrides in peck.json.
  • Monorepo Challenges: If the codebase spans multiple languages/frameworks, Peck’s PHP-centric focus could limit broader adoption.

Integration Feasibility

Peck’s integration hinges on three pillars:

  1. System Dependencies: GNU Aspell must be installed across all environments (dev, CI, staging). This is feasible but introduces cross-platform complexity (e.g., Windows support via WSL/Scoop).
  2. Composer Workflow: The tool’s CLI nature allows for pre-commit hooks (via husky/laravel-valet) or CI gates (GitHub Actions, GitLab CI). Example:
    # GitHub Actions
    - name: Run Peck
      run: composer test:typos  # Custom script to invoke ./vendor/bin/peck
    
  3. Configuration Overrides: The peck.json preset system enables team-specific rules (e.g., ignoring laravel framework terms or project-specific acronyms).

Feasibility Score:

Criteria Score (1-5) Notes
Dev Environment 4 Requires Aspell install; minimal Laravel config changes.
CI/CD 3 Aspell setup adds ~5-10 mins to CI pipeline; Windows may need WSL.
Cross-Platform 3 Windows support is viable but less polished than Linux/macOS.
Laravel Compatibility 5 Laravel preset reduces setup time; no core conflicts.

Technical Risk

Risk Area Severity (1-5) Mitigation Strategy
Aspell Dependency 4 Document Aspell installation in CONTRIBUTING.md; provide Docker/WSL fallback.
False Positives 3 Leverage peck.json to whitelist project-specific terms; start with --ignore-all.
Performance 2 Benchmark on large codebases (e.g., 100K+ LOC); cache Aspell dictionaries.
Breaking Changes 4 Monitor Peck’s GitHub for v1.0 release; pin version in composer.json.
IDE Integration 1 No risk; Peck is CLI-only (complements IDE plugins like PHPStorm’s spell-check).

Critical Question:

  • How will we handle Aspell installation in CI for Windows runners? (Options: WSL, Scoop, or skip Windows CI for Peck checks.)

Key Questions for TPM

  1. Adoption Scope:

    • Should Peck be mandatory in CI (blocking PRs) or optional (best-effort)?
    • Which environments (dev, staging, prod) should enforce Peck checks?
  2. Configuration Management:

    • Should peck.json be version-controlled or environment-specific?
    • How will we handle team-specific dictionaries (e.g., domain jargon)?
  3. Tooling Stack:

    • Will Peck replace or complement existing tools (e.g., PHPStan for naming rules)?
    • Should we integrate Peck with pre-commit hooks (e.g., via laravel-valet)?
  4. Long-Term Viability:

    • What’s the upgrade path if Peck reaches v1.0?
    • Should we contribute to Peck’s development (e.g., Laravel-specific rules)?

Integration Approach

Stack Fit

Peck’s integration targets three layers of the Laravel ecosystem:

  1. Developer Workflow:

    • Local Development: Add to package.json scripts or .husky/pre-commit:
      "scripts": {
        "check:typos": "php vendor/bin/peck"
      }
      
    • IDE Support: Use as a external tool in PHPStorm/VSCode (run ./vendor/bin/peck manually).
  2. CI/CD Pipeline:

    • GitHub Actions: Add to existing workflows (e.g., after composer install):
      - name: Spell Check
        run: composer check:typos
      
    • GitLab CI: Use before_script to install Aspell and run Peck.
  3. Laravel-Specific Hooks:

    • Artisan Command: Create a custom command (e.g., php artisan peck) to wrap Peck’s CLI.
    • Service Provider: Register Peck as a console command for Artisan integration.

Migration Path

Phase Action Items Risks Mitigation
Pilot 1. Install Peck in a non-critical branch. False positives. Use --ignore-all initially.
2. Test with peck --init and Laravel preset. Aspell setup issues. Document Aspell install steps.
Validation 3. Run manually in local dev environments. Performance lag. Benchmark on a subset of files.
4. Integrate with pre-commit hooks (optional). Developer friction. Make it opt-in.
CI Integration 5. Add to GitHub Actions/GitLab CI as a non-blocking step. CI flakiness. Isolate Aspell install in a job.
Enforcement 6. Block PRs with Peck failures (optional). Team resistance. Start with warnings, then enforce.
Optimization 7. Refine peck.json for team-specific rules. Maintenance overhead. Use shared config templates.

Rollout Timeline:

  • Week 1-2: Pilot in a feature branch.
  • Week 3: CI integration (non-blocking).
  • Week 4+: Gradual enforcement (e.g., warnings → blocking).

Compatibility

Component Compatibility Notes
PHP Version Requires PHP 8.2+; no conflicts with Laravel’s supported versions (8.2+).
Laravel Version Tested with Laravel 8+; preset includes Symfony 8+ compatibility.
Operating Systems Linux/macOS: Native support. Windows: Requires WSL/Scoop.
Existing Tools - Pint/PHP-CS-Fixer: No conflicts (Peck checks content, not formatting).
- PHPStan: Complementary (Peck for naming, PHPStan for logic).
- Pest: No overlap (Peck doesn’t analyze test logic).
Monorepos Limited support; focus on PHP/Laravel directories only.

Sequencing

  1. Prerequisite: Install GNU Aspell in all environments (dev, CI).
  2. Initial Setup:
    • Add Peck to composer.json (--dev).
    • Run ./vendor/bin/peck --init to generate peck.json.
  3. Configuration:
    • Apply Laravel preset ("preset": "laravel").
    • Whitelist project-specific terms (e.g., acronyms, frameworkTerms).
  4. Testing:
    • Run manually to identify false positives.
    • Adjust peck.json as needed.
  5. Automation:
    • Add to CI pipeline (non-blocking initially).
    • Integrate with pre
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
emuniq/filament-browser-notifications
syriable/filament-translator
hungnm28/livewire-form
wenprise/eloquent
crudly/encrypted
fadion/bouncy
cuci/prototurk-sdk
gos/pubsub-router-bundle
cuci/prototurk-sdk-symfony
clementtalleu/easyadmin-markdown-bundle
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui