ObliviousHarmony / vscode-php-codesniffer

A VS Code extension for integrating PHP_CodeSniffer.
https://marketplace.visualstudio.com/items?itemName=obliviousharmony.vscode-php-codesniffer
Other
40 stars 2 forks source link

`Automatic` Standard Option #59

Closed ObliviousHarmony closed 1 year ago

ObliviousHarmony commented 1 year ago

Problem Description

Since there is only a single option for setting a custom standard, cases in which a repository has multiple phpcs.xml files are not easily supported.

Proposed Solution

There should be a new Automatic option for phpCodeSniffer.standard that searches for one of the default custom standard files (.phpcs.xml, phpcs.xml, .phpcs.xml.dist, phpcs.xml.dist). It should start in the document's directory and work upward until it reaches the workspace root, just like it does for autoExecutable.

Alternative Solutions

I also considered a phpCodingStandard.workingDirectory option that would set the worker's working directory, but, having the relative path to the coding standard change seems error-prone.