Download the PHP package devanoxltd/laravel-revive without Composer
On this page you can find all versions of the php package devanoxltd/laravel-revive. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download devanoxltd/laravel-revive
More information about devanoxltd/laravel-revive
Files in devanoxltd/laravel-revive
Package laravel-revive
Short Description Automatic configuration for Laravel apps to apply Devanox's standard linting & code standards.
License MIT
Homepage https://github.com/devanoxltd/laravel-revive
Informations about the package laravel-revive

Laravel Revive
Automatically apply Devanox's default code style for Laravel apps.
Revive is built on top of the following tools:
- TLint: lints Laravel and PHP code for issues not covered by other tools
- using the default
Devanoxpreset
- using the default
- PHP_CodeSniffer: sniffs issues that can't be fixed automatically
- using the
Devanoxpreset which is mostly PSR1 with some Devanox-specific rules
- using the
- PHP CS Fixer: adds custom rules not supported by Laravel Pint
CustomOrderedClassElementsFixerDevanox-specific order of class elements
- Pint: Laravel's code style rules (with a few Devanox specific customizations)
- using the default
Laravelpreset with some Devanox-specific rules
- using the default
You can view a list of the compiled rules and examples of what they do in the style guide.
Installation
You can install the package via composer:
Optionally you can publish a GitHub Actions config:
Or you can publish Husky Hooks:
If you are using a containerized environment and do not have PHP installed locally, you can use the --env option to specify it:
Supported environments are ddev, warden lando, and sail.
Usage
To lint everything at once:
To fix everything at once:
To revive only files that have uncommitted changes according to Git, you may use the --dirty option:
To view all available commands:
Usage with Sail
Alternatively, Sail has a bin script that eases the execution of package binaries, so you do the same thing like this:
Customizing
If you need to include or exclude files or directories for each tool you can create a revive.json config file in your project root:
To run additional scripts as part of Revive first add them to revive.json as part of scripts separated into lint and fix.
The key is the name of the command (used with the --using flag), and the value is an array of arguments passed to Symfony\Component\Process\Process.
Revive will pick these up automatically when running either lint or fix.
By default, additional scripts timeout after 60 seconds. You can overwrite this setting using the processTimeout key.
To customize which tools Revive runs, or the order in which they are executed you can use the --using flag and supply a comma-separated list of commands:
TLint
Create a tlint.json file in your project root. Learn more in the TLint documentation.
PHP_CodeSniffer
Create a .phpcs.xml.dist file in your project root with the following:
Now you can add customizations below the <rule ref="Devanox"/> line or even disable the Devanox rule to use your own ruleset. Learn more in this introductory article.
PHP CS Fixer
Create a .php-cs-fixer.dist.php file in your project root with the contents from PHP CS Fixer documentation.
Pint
Create a pint.json file in your project root, you can use Pint documentation.
GitHub Action
There's a GitHub Action you use to clean-up your workflows.
Warning Heads Up! Workflows that commit to your repo will stop any currently running workflows and not trigger another workflow run.
One solution is to run your other workflows after Revive has completed by updating the trigger on those workflows:
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security-related issues, please email [email protected] instead of using the issue tracker.
Credits
- Matt Stauffer
- Anthony Clark
- Tom Witkowski - much of the original idea and syntax for this was inspired by his
elbgoods/ci-test-toolspackage - All Contributors
- Tighten This package is a fork of Tighten's
duster
License
The MIT License (MIT). Please see License File for more information.