sublime-phpcs
sublime-phpcs copied to clipboard
Sublime Text 3 sublime-phpcs package --using-cache=off is getting an error it should be "yes" or "no"
Bug report
Before reporting a bug, make sure PHP CS Fixer is up-to-date.
Please describe the problem and provide technical details such as:
- PHP version: 8.0.6
- PHP CS Fixer version: 3.0.0
- the command used to run PHP CS Fixer (run with
-vvv)
In ConfigurationResolver.php line 831:
[PhpCsFixer\ConfigurationException\InvalidConfigurationException (16)]
Expected "yes" or "no" for option "using-cache", got "off".
Exception trace:
at C:\Users\gethe\AppData\Roaming\Composer\vendor\friendsofphp\php-cs-fixer\src\Console\ConfigurationResolver.php:831
PhpCsFixer\Console\ConfigurationResolver->resolveOptionBooleanValue() at C:\Users\gethe\AppData\Roaming\Composer\vendor\friendsofphp\php-cs-fixer\src\Console\ConfigurationResolver.php:448
PhpCsFixer\Console\ConfigurationResolver->getUsingCache() at C:\Users\gethe\AppData\Roaming\Composer\vendor\friendsofphp\php-cs-fixer\src\Console\Command\FixCommand.php:274
PhpCsFixer\Console\Command\FixCommand->execute() at C:\Users\gethe\AppData\Roaming\Composer\vendor\symfony\console\Command\Command.php:256
Symfony\Component\Console\Command\Command->run() at C:\Users\gethe\AppData\Roaming\Composer\vendor\symfony\console\Application.php:971
Symfony\Component\Console\Application->doRunCommand() at C:\Users\gethe\AppData\Roaming\Composer\vendor\symfony\console\Application.php:290
Symfony\Component\Console\Application->doRun() at C:\Users\gethe\AppData\Roaming\Composer\vendor\friendsofphp\php-cs-fixer\src\Console\Application.php:97
PhpCsFixer\Console\Application->doRun() at C:\Users\gethe\AppData\Roaming\Composer\vendor\symfony\console\Application.php:166
Symfony\Component\Console\Application->run() at C:\Users\gethe\AppData\Roaming\Composer\vendor\friendsofphp\php-cs-fixer\php-cs-fixer:113
- the configuration (file) you used: using a Sublime Text 3
.phpcsfixerfile
return PhpCsFixer\Config::create()->setRules([
'@PSR1' => true,
'@PSR2' => true,
'array_syntax' => [
'syntax' => 'short'
],
'no_unused_imports' => true
]);
I'm using Sublime Text 3 SublimeLinter-PHPCSFixer package to auto initiate this.
Can you guys update the command that is being run? to use --using-cache=off
Hi there @skeeith
I cannot replicate this, could you please provide a little more detal, perhaps your sublime-phpcs configuration file?
This is my test
[Phpcs] Linter found 0 errors
[Phpcs] Sniffer found 1 errors
[Phpcs] Fixer
[Phpcs] /opt/homebrew/bin/php /opt/homebrew/bin/php-cs-fixer fix /Users/ben/git/github/benmatselby/trello-cli/src/Client.php --verbose
[Phpcs] /opt/homebrew/bin/php /opt/homebrew/bin/php-cs-fixer fix /Users/ben/git/github/benmatselby/trello-cli/src/Client.php --verbose
[Phpcs] cwd: /Users/ben
[Phpcs] PHP CS Fixer 3.35.1 (ec1ccc2) Freezy Vrooom by Fabien Potencier and Dariusz Ruminski.
PHP runtime: 8.2.11
Loaded config default.
Using cache file ".php-cs-fixer.cache".
F 1 / 1 (100%)
Legend: .-no changes, F-fixed, S-skipped (cached or empty file), I-invalid file syntax (file ignored), E-error
1) git/github/benmatselby/trello-cli/src/Client.php (braces_position)
Fixed 1 of 1 files in 0.018 seconds, 14.000 MB memory used
reloading /Users/ben/git/github/benmatselby/trello-cli/src/Client.php
reloading /Users/ben/git/github/benmatselby/sublime-phpcs/Changelog.md
- PHP version: 8.2.11
- PHP CS Fixer version: 3.35.1
- This is using the latest version of this plugin.
hey @benmatselby this is my config
my SublimePhpCsFixer.sublime-settings
{
"config": "C:/Users/dusme/Dropbox/Sublime/Windows/.php-cs-fixer.php",
"on_save": false
}
my .php-cs-fixer.php file
<?php
return (new PhpCsFixer\Config())->setRules([
'@PSR12' => true,
'array_syntax' => ['syntax' => 'short'],
'no_unused_imports' => true
]);
I don't know if this helps, let me know if you need more config details