Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relative phpstan executable generates elisp errors. #10

Open
kwvanderlinde opened this issue Jul 20, 2018 · 4 comments
Open

Relative phpstan executable generates elisp errors. #10

kwvanderlinde opened this issue Jul 20, 2018 · 4 comments
Assignees

Comments

@kwvanderlinde
Copy link

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
Copy link
Author

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
Copy link

ejmr commented Jul 21, 2018

@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 zonuexe self-assigned this Jul 21, 2018
zonuexe added a commit that referenced this issue Jul 21, 2018
GitHub-Issue: 10
#10

This is a simple mistake. This function requires a string list, this
pattern assigns just a string to the variable.
Since a character string is a type of sequence, the append function
treats it as a vector of char(int) instead of type error.

This issue was reported by @kwvanderlinde, thanks!
@zonuexe
Copy link
Member

zonuexe commented Jul 21, 2018

@kwvanderlinde @ejmr Thanks for reporting!
This problem was fixed in #11.

@kwvanderlinde
Copy link
Author

Thank you! That was an incredible response time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants