dense-analysis / ale

Check syntax in Vim/Neovim asynchronously and fix files, with Language Server Protocol (LSP) support
BSD 2-Clause "Simplified" License
13.56k stars 1.44k forks source link

phpcs config that relies on paths relative to the project root don't work #3146

Open betterphp opened 4 years ago

betterphp commented 4 years ago

Information

VIM version

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Apr 26 2020 17:02:50)
Included patches: 1-647

Operating System: Ubuntu 19.10 Terminal: Alacritty + tmux

What went wrong

We have a custom path set for the phpcs config and since the phpcs command was update in this commit it hasn't worked.

The issue can be worked around by using the default name and having phpcs search up the directory tree for the config file as mentioned in #2533. However, we also have some custom sniffs that are loaded relative to the working directory and there is no way around that as far as I can tell :(

Reproducing the bug

  1. Set let g:ale_php_phpcs_standard = './ruleset.xml'
  2. Make Ale do PHP linting

:ALEInfo

(finished - exit code 3) ['/bin/bash', '-c', 'cd ''/home/jacek/Desktop/development/the/real/folder' && ''/home/jacek/Desktop/development/.../'vendor/bin/phpcs'' -s --report=emacs --stdin-path=''/home/jacek/Desktop/development/.../file.php'' --standard=''./ruleset.xml'' < ''/tmp/vA6usb1/104/file.php''']
<<<OUTPUT STARTS>>>
ERROR: the "./ruleset.xml" coding standard is not installed. The installed coding standards are PSR1, PEAR, MySource, Squiz, Zend, PSR2 and PSR12
<<<OUTPUT ENDS>>>

I changed a few of the paths there, they were valid and pointed to the correct files (except the ruleset) in actual output.

nathanielks commented 4 years ago

I've observed this as well. Downgrading to 2.4.0 restored the functionality.

hsanson commented 4 years ago

This seems related: #3250