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.
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 forphpCodeSniffer.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 forautoExecutable
.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.