benmatselby / sublime-phpcs

🔍 PHP CodeSniffer, PHP Coding Standard Fixer, Linter, and Mess Detector Support for Sublime Text
Other
814 stars 126 forks source link

Sublime Text 3 sublime-phpcs package --using-cache=off is getting an error it should be "yes" or "no" #202

Open skeeith opened 3 years ago

skeeith commented 3 years ago

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:

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 `.phpcsfixer` file

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`
benmatselby commented 1 year ago

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
skeeith commented 1 year ago

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