Automatic configuration for Laravel apps to apply Tighten's standard linting & code standards.
Automatically apply Tighten's default code style for Laravel apps:
- PHPCS, with PSR-12 + some special preferences
- Tighten's Tlint
- Maybe JS and CSS?
To achieve this, this package installs PHPCS (and PHPCBF with it) and Tlint, and automatically configures them. Tlint uses the default
Tighten preset. PHPCS uses the
Tighten preset which is
PSR-12 and a few Tighten-specific rules.
You can install the package via composer:
composer require tightenco/duster --dev ./vendor/bin/duster init
You must run
./vendor/bin/duster init after installing, or you won't have a local copy of the PHPCS config file, and Duster won't work.
init command will also optionally add a GitHub action to run Duster's linters.
To lint everything at once:
To fix everything at once:
To run individual lints:
./vendor/bin/duster tlint ./vendor/bin/duster phpcs
To run individual fixes:
./vendor/bin/duster tlint fix ./vendor/bin/duster phpcs fix
To override the configuration for PHPCS, you can edit the
.phpcs.xml.dist file and add customizations below the
<rule ref="Tighten"/> line or even disable the Tighten rule and use your own ruleset. Learn more in this introductory article.
To override the configuration for Tlint, create a
tlint.json file in your project root. Learn more in the Tlint documentation.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email email@example.com instead of using the issue tracker.
- Matt Stauffer
- Tom Witkowski - much of the original idea and syntax for this was inspired by his
- All Contributors
The MIT License (MIT). Please see License File for more information.