benmatselby / sublime-phpcs

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

Question: php-cs-fixer config file path in sublime-project? #143

Open hansott opened 9 years ago

hansott commented 9 years ago

I would like to run php-cs-fixer with the --config-file=.php_cs argument. But it seems that the file is not found. Can I make use of the $project_path variable to get the correct path?

Thanks!

My sublime project file:

{
    "folders": [
         ...
    ],
    "phpcs": {
        "php_cs_fixer_additional_args": {
             "--config-file": ".php_cs"
        }
    }
}
thibaultlavoisey commented 8 years ago

Any news about this issue? Will be nice if sublime-phpcs can detect .php_cs file at project root and use it.

benmatselby commented 8 years ago

@thibaultlavoisey @hansott Hi folks.. I don't have a lot of time to look at this at the moment, but I would happily review and merge a pull request

benmatselby commented 8 years ago

@hansott @thibaultlavoisey It works if you specify the full file path, but I'm assuming you know that?

Luc45 commented 7 years ago

Hello,

I'm trying to set specific rules per project basis, so I tried this:

{
    "folders": [
        {
        "path": "E:\\laragon\\www\\oldsite"
    }
    ],
    "phpcs": {
        "php_cs_fixer_additional_args": {
             "--config-file": "C:\\Users\\lucas.figueiredo\\.oldphpcsfixer"
        }
    }
}

And this:

    "settings": {
        "phpcs": {
            "phpcs_additional_args": {
                "--config": "C:\\Users\\lucas.figueiredo\\.oldphpcsfixer"
            }
        }
    }

But neither worked.

It seems --config is the argument that PHP CS listens to, according to their documentation. I have limited knowledge, but it seems to be only a matter of passing the --config argument per project basis. Unfortunately I have zero knowledge of Python.

Similar issue:

32

PS: Thanks for supporting the open-source community.