Relative phpstan executable generates elisp errors.
Opened this issue · 4 comments
kwvanderlinde commented
My .dir-locals.el
file looks like this:
((php-mode
(flycheck-checker . phpstan)
(php-project-root . git)
(phpstan-executable . (root . "untracked/vendor/bin/phpstan"))
))
When I open one of my PHP files, I get presented with this error from flycheck:
Error while checking syntax automatically: (error "Invalid result from evaluation of (phpstan-get-command-args): (47 104 111 109 101 47 107 101 110 110 101 116 104 47 101 120 97 109 112 108 101 47 117 110 116 114 97 99 107 101 100 47 118 101 110 100 111 114 47 98 105 110 47 112 104 112 115 116 97 110 \"analyze\" \"--errorFormat=raw\" \"--no-progress\" \"--no-interaction\" \"-c\" \"/home/kenneth/example/phpstan.neon.dist\" \"-l\" \"0\")")
If I change the .dir-locals.el
to use the equivalent absolute path, it works fine:
((php-mode
(flycheck-checker . phpstan)
(php-project-root . git)
(phpstan-executable . "/home/kenneth/example/untracked/vendor/bin/phpstan")
))
I would expect these two cases to have equivalent behaviour.
kwvanderlinde commented
I looked into it and discovered that this is the one case in which phpstan-get-executable
does not return a list. Instead it just returns the string returned by expand-file-name
.
ejmr commented
@zonuexe If we get an empty string back then would find-executable
by a viable alternative? (Obviously I have not tested it myself---sorry.)
zonuexe commented
@kwvanderlinde @ejmr Thanks for reporting!
This problem was fixed in #11.
kwvanderlinde commented
Thank you! That was an incredible response time!