Skip to content

pekral/pint-rules

Repository files navigation

pint-rules

Latest Version License Downloads


🚀 Introduction

pint-rules is an extensible package of custom rules for Laravel Pint that helps you maintain consistent code style and high code quality in your PHP projects.


📦 Installation

composer require --dev pekral/pint-rules

During install (or update), a pint.json file is created in your project root if it does not already exist. To overwrite an existing pint.json with the package default, run:

vendor/bin/pint-rules install --force

⚙️ Usage

  1. Use the pint.json in your project root (created by the installer), or point Pint to the package config.
  2. Run Pint with this configuration:
./vendor/bin/pint --config=vendor/pekral/pint-rules/pint.json

📝 Usage Examples

Code check

./vendor/bin/pint --config=vendor/pekral/pint-rules/pint.json src/

Automatic fix

./vendor/bin/pint --config=vendor/pekral/pint-rules/pint.json --fix src/

Example configuration (pint.json)

{
    "preset": "vendor/pekral/pint-rules/pint.json",
    "rules": {
        // Your custom rules here
    }
}

Rule Examples

Rules can be customized in your pint.json; see the Laravel Pint documentation for available rules and configuration.


⚙️ Configuration

  • Rules can be extended and customized in pint.json.
  • Supports PHP 8.4+.
  • Easy integration with CI/CD (GitHub Actions, GitLab CI, ...).

🔧 Development & CI

The project uses the same GitHub Actions and Composer scripts as pekral/php-skeleton:

  • .github/workflows/checkers.yml — PHPCS, Pint, Rector, PHPStan, tests with coverage, security audit, composer validate/normalize, XML lint (on push/PR to master/main and weekly).
  • .github/workflows/stale.yml — Marks and closes stale issues/PRs (daily + manual).
  • .github/dependabot.yml — Weekly updates for Composer and GitHub Actions.

Local commands (same as CI):

composer check   # Full quality pipeline (normalize, phpcs, pint, rector, phpstan, audit, tests)
composer fix     # Apply all automatic fixes (normalize, rector, pint, phpcs)

❓ FAQ

Q: How do I add a custom rule? A: Add it to your pint.json or extend this package.

Q: How do I run Pint only on specific folders? A: Adjust the path in the Pint command, e.g. src/, app/.

Q: How can I contribute? A: Open an issue or pull request on GitHub.


🔗 Further Resources


📝 License

This package is licensed under the MIT license.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages