wongjn / vscode-php-sniffer

Visual Studio Code extension for PHP_Codesniffer validation and formatting.
https://marketplace.visualstudio.com/items?itemName=wongjn.php-sniffer
MIT License
46 stars 7 forks source link

Only run if `.phpcs.xml` was found in project #53

Open Sir-Will opened 3 years ago

Sir-Will commented 3 years ago

Is your feature request related to a problem? Please describe. Opening random PHP files which are not formatted for PHP Sniffer always highlights tons of errors which makes it difficult to read.

Describe the solution you'd like It would be great if there is an option which makes PHP Sniffer to only run if there is a .phpcs.xml file in the project because projects formatted for PHP Sniffer usually have the config file. This way it's automatically disabled for all PHP files and only enabled for projects which use PHP Sniffer.

Describe alternatives you've considered Disabling PHP Sniffer globally and creating a workspace for each project and turning it on for these workspaces.

wongjn commented 3 years ago

Thank you for your feedback. Any extension can be disabled on a per-workspace basis — could this not fulfil this request or is it more nuanced than that?

Sir-Will commented 3 years ago

Yea that's what I described as alternative though it would be more convenient to not have to create a workspace and enable the extension there.