ObliviousHarmony / vscode-php-codesniffer

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

Stabilize Working Directory #65

Closed ObliviousHarmony closed 1 year ago

ObliviousHarmony commented 1 year ago

All Submissions:

Changes proposed in this Pull Request:

The working directory passed to phpcs would depends entirely on whether or not phpCodeSniffer.autoExecutable is enabled. When it is and it finds an executable, the working directory will be changed to the directory it found it in rather than the workspace root. This means that relative paths for standardCustom options are inconsistent without a clear explanation as to why.

Now that we have the "Automatic" standard option, there's no longer a reason to rely on the directory traversal provided by PHPCS. We should now set the workspace root as the working directory and never change it.

Note: This is a breaking change! Relative paths in phpCodeSniffer.standard may stop working, but, fixing them will be relatively easy.

Closes #60.

How to test the changes in this Pull Request:

  1. Extension should still work