Closed Rastusik closed 7 years ago
Hi @Rastusik,
You need to create a config file for PHP CS Fixer.
Inside that config file, you should create a Finder
where you can exclude()
folders or use notPath()
for specific files.
$finder = PhpCsFixer\Finder::create()
->exclude('somedir')
->notPath('src/Symfony/Component/Translation/Tests/fixtures/resources.php')
->in(__DIR__);
More info on https://github.com/FriendsOfPHP/PHP-CS-Fixer just above the caching title and on http://symfony.com/doc/current/components/finder.html
Hi @Landerstraeten,
are you sure about this? I already tried that and it didn't work. The point is that the files that need to be checked are being fetched from GitPreCommitContext (https://github.com/phpro/grumphp/blob/master/src/Task/PhpCsFixerV2.php#L69) and then this code gets triggered: https://github.com/phpro/grumphp/blob/master/src/Task/AbstractPhpCsFixerTask.php#L118 which will create a separate process for each file added to git index. I think the FileFinder is skipped in this process.
Or did I do something wrong? Maybe somebody could test this as well, to confirm?
Which (exact) version of grumphp and php-cs-fixer are you using? Can you also post your grumphp.yml and .php_cs configuration?
oh, I wasn't on the 0.12 version of grumphp, I was on 0.11.6 ... thanks for help
Hi, I'd like to have an option to be able to exclude selected files from PHP CS Fixer scan. Would that be possible?
Thanks