feat: add "laravel/pint" integration feature #7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Added ability to use
laravel/pint
as a formatter.The formatter tool used is
php-cs-fixer
by default. If you want to uselaravel/pint
, change thephp-cs-fixer.activateTool
setting incoc-settings.json
.Add Configration
php-cs-fixer.activateTool
: Formatter tool to be used, valid option["php-cs-fixer", "pint"]
, default:"php-cs-fixer"
php-cs-fixer.pint.toolPath
: The path to the pint tool, default:""
php-cs-fixer.pint.config
: Path topint.json
config file (--config
), default:""
php-cs-fixer.pint.preset
: Presets define a set of rules that can be used to fix code style issues in your code (--preset
), valid option["laravel", "psr12", "symfony"]
, default:"laravel"
Add Command
php-cs-fixer.pintFix
: Run pintphp-cs-fixer.pintDownload
: Download pintAdd Code Action
Run: php-cs-fixer.pintFix
Add Completion and JSON validation
pint.json
Auto Completion and JSON validationDEMO (mp4)
coc-php-cs-fixer-pint.mp4
Note
Tool detection
Detects the
pint
tool. They are prioritized in order from the top.php-cs-fixer.pint.toolPath
vendor/bin/pint
pint
retrieved by the download feature (:CocCommand
php-cs-fixer.pintDownload`)~/.config/coc/extensions/coc-php-cs-fixer-data/pint
~/AppData/Local/coc/extensions/coc-php-cs-fixer-data/pint
If "1" and "2" above are not detected, the download feature will be executed (The prompt will be displayed)
Precedence of "laravel/pint" configuration files and options
php-cs-fixer.pint.config
setting for this extension.pint.json
config file in the workspace (project) root.php-cs-fixer.pint.preset
.