junstyle / vscode-php-cs-fixer

PHP CS Fixer extension for VS Code

Home Page:https://marketplace.visualstudio.com/items?itemName=junstyle.php-cs-fixer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Exclude specific file trouble

ftytecaActual opened this issue · comments

Hello Junstyle and thanks for your work.

I'm on Ubuntu 20.04, VSCode 1.63, php-cs-fixer 2.19.3 and using junstyle.php-cs-fixer v0.2.10.

For my work I would want some files to be ignored when I save them.
here are my workspace settings

{
    "php-cs-fixer.onsave": true,
    "php-cs-fixer.config": ".php_cs",
    "php-cs-fixer.executablePath": "/path/to/php-cs-fixer-2",
    "php-cs-fixer.exclude": ["file1.php", "file2.php"],
}

I've added this exclude file in .php_cs too but no success.

$finder = PhpCsFixer\Finder::create()
    ->in(__DIR__)
    ->name('*.php')
    ->notName('*.blade.php')
    ->ignoreDotFiles(true)
    ->ignoreVCS(true)
    ->exclude([
        'bootstrap',
        'config',
        'node_modules',
        'public',
        'resources',
        'routes',
        'storage',
        'vendor',
    ])
    ->notPath([
        'file1.php',
        'file2.php',
    ])
    ->in(__DIR__);

When I'm working on this file1/2.php, and I save it, I would like php-cs-fixer rules not to be applied.

Yes it's an old version of cs-fixer but my coworkers are in love with this one particularly.
What am I doing wrong ?
Thanks for your time.

**/file1.php