- How do I enforce Tighten’s Laravel code standards in CI without breaking builds?
- Use Duster’s GitHub Actions integration (`./vendor/bin/duster github-actions`) to auto-fix issues pre-commit or in CI. Start with `--dirty` to target only uncommitted changes, then adjust timeouts in the workflow if needed. For strict enforcement, combine with `fix` commands in a separate workflow step.
- Can Duster replace PHPStan or custom linters in my Laravel project?
- Duster focuses on linting/formatting (Pint, TLint, PHP_CodeSniffer, CS Fixer) and doesn’t replace static analysis tools like PHPStan. Use it alongside PHPStan for broader coverage. Customize `duster.json` to exclude files already handled by other tools to avoid redundancy.
- What Laravel versions does Duster support, and does it work with older projects?
- Duster targets modern Laravel (8.x+) due to its Pint dependency, but you can manually install Pint v1.0+ for older versions. Test compatibility by running `./vendor/bin/duster lint` on a subset of legacy code. For pre-8.x, consider alternatives like PHP CS Fixer alone.
- How do I customize Duster’s PHP_CodeSniffer or Pint rules beyond the Tighten preset?
- Extend the Tighten preset by publishing custom configs (e.g., `.phpcs.xml.dist`) and referencing them in `duster.json`. Override Pint rules via `pint.json` or use `--using` flags to exclude tools. For advanced cases, add custom scripts in `duster.json` using Symfony Process.
- Will Duster slow down my CI pipeline for large Laravel codebases?
- Duster parallelizes PHP CS Fixer (v3.1+) but TLint/PHP_CodeSniffer may still be slow. Mitigate this by: 1) Using `--dirty` to limit scope, 2) Adjusting GitHub Actions timeouts, or 3) Running heavy tools (e.g., PHPStan) in separate jobs. Profile with `duster lint --verbose` to identify bottlenecks.
- How do I integrate Duster with Laravel Sail or Docker environments?
- Run Duster directly in Sail via `./vendor/bin/sail bin duster` or use the `--env` flag for containerized setups (e.g., `--env=sail`). For Docker (DDEV/Lando), ensure PHP and dependencies are installed in the container. Avoid running Duster locally if your container lacks Git history for `--dirty` to work.
- What happens if my team’s coding standards differ from Tighten’s presets?
- Duster’s flexibility lets you override defaults: Publish custom `.phpcs.xml`, `pint.json`, or `duster.json` files. Start by comparing Tighten’s rules to your style guide, then adjust include/exclude patterns or tool ordering. Document changes in your team’s README to maintain consistency.
- Can I use Duster for Blade templates or migrations without conflicts?
- Duster processes Blade files by default, but migrations may need exclusion if they violate Tighten’s rules. Use `duster.json` to exclude `database/migrations` or adjust Pint’s `blade` rules. Test with `./vendor/bin/duster lint --path=database/migrations` to preview conflicts before enforcing.
- How do I debug Duster failures or tool compatibility issues?
- Start with `--verbose` to log tool outputs. Check for conflicts between Duster’s configs and existing `.phpcs.xml`/`pint.json`. Isolate issues by running tools individually (e.g., `./vendor/bin/php-cs-fixer fix`). For Pint/TLint errors, consult their docs or open issues on their repos.
- Are there alternatives to Duster for Laravel code quality?
- For linting/formatting, consider standalone tools like Pint (Laravel’s formatter), PHP CS Fixer, or TLint alone. For broader quality checks, combine Duster with PHPStan, Pest, or Laravel’s built-in tools. Alternatives like `laravel-shift/blueprint` offer opinionated setups but lack Duster’s Git-aware workflows.