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

Conflict with asdf error output #810

Closed
lunks opened this issue Jul 26, 2017 · 12 comments
Closed

Conflict with asdf error output #810

lunks opened this issue Jul 26, 2017 · 12 comments

Comments

@lunks
Copy link

lunks commented Jul 26, 2017

I just installed ale and it seems it doesn't understand asdf output. I get an error for every possible linter I don't have installed.

Whenever I save, I get Error detected while processing function <SNR>158_NeoVimCallback[29]..<SNR>154_HandleExit[41]..ale_linters#ruby#brakeman#Handle for every linter but rubocop.

How can I make at least the error go away until ale understand this output better?


 Current Filetype: ruby
Available Linters: ['brakeman', 'rails_best_practices', 'reek', 'rubocop', 'ruby']
  Enabled Linters: ['brakeman', 'rails_best_practices', 'reek', 'rubocop', 'ruby']
 Linter Variables:

let g:ale_ruby_brakeman_options = ''
let g:ale_ruby_reek_show_context = 0
let g:ale_ruby_reek_show_wiki_link = 0
let g:ale_ruby_rubocop_executable = 'rubocop'
let g:ale_ruby_rubocop_options = ''
 Global Variables:

let g:ale_echo_cursor = 1
let g:ale_echo_msg_error_str = 'Error'
let g:ale_echo_msg_format = '%s'
let g:ale_echo_msg_warning_str = 'Warning'
let g:ale_enabled = 1
let g:ale_fix_on_save = 0
let g:ale_fixers = {}
let g:ale_keep_list_window_open = 0
let g:ale_lint_delay = 200
let g:ale_lint_on_enter = 1
let g:ale_lint_on_save = 1
let g:ale_lint_on_text_changed = 'always'
let g:ale_linter_aliases = {}
let g:ale_linters = {}
let g:ale_open_list = 0
let g:ale_set_highlights = 1
let g:ale_set_loclist = 1
let g:ale_set_quickfix = 0
let g:ale_set_signs = 1
let g:ale_sign_column_always = 0
let g:ale_sign_error = '>>'
let g:ale_sign_offset = 1000000
let g:ale_sign_warning = '--'
let g:ale_statusline_format = ['%d error(s)', '%d warning(s)', 'OK']
let g:ale_warn_about_trailing_whitespace = 1
  Command History:

(finished - exit code 1) ['bash', '-c', 'brakeman -f json -q  -p ''/Users/lunks/code/helabs/wellzesta/wellzestahealth-server''']

<<<OUTPUT STARTS>>>
No such command in 2.4.1 of ruby
<<<OUTPUT ENDS>>>

(finished - exit code 1) ['bash', '-c', '''rails_best_practices'' --silent -f json --output-file /dev/stdout ''/Users/lunks/code/helabs/wellzesta/wellzestahealth-server''']

<<<OUTPUT STARTS>>>
No such command in 2.4.1 of ruby
<<<OUTPUT ENDS>>>

(started) ['bash', '-c', '''rubocop'' --format json --force-exclusion  --stdin ''/Users/lunks/code/helabs/wellzesta/wellzestahealth-server/app/graphql/wellzestahealth_server_schema.rb'' < ''/tmp/nvimHLztus/11/wellzestahealth_server_schema.rb''']
(finished - exit code 0) ['bash', '-c', 'ruby -w -c -T1 ''/tmp/nvimHLztus/12/wellzestahealth_server_schema.rb''']

<<<NO OUTPUT RETURNED>>>

(finished - exit code 1) ['bash', '-c', 'brakeman -f json -q  -p ''/Users/lunks/code/helabs/wellzesta/wellzestahealth-server''']

<<<OUTPUT STARTS>>>
No such command in 2.4.1 of ruby
<<<OUTPUT ENDS>>>

(finished - exit code 1) ['bash', '-c', '''rails_best_practices'' --silent -f json --output-file /dev/stdout ''/Users/lunks/code/helabs/wellzesta/wellzestahealth-server''']

<<<OUTPUT STARTS>>>
No such command in 2.4.1 of ruby
<<<OUTPUT ENDS>>>

(finished - exit code 0) ['bash', '-c', '''rubocop'' --format json --force-exclusion  --stdin ''/Users/lunks/code/helabs/wellzesta/wellzestahealth-server/app/graphql/wellzestahealth_server_schema.rb'' < ''/tmp/nvimHLztus/13/wellzestahealth_server_schema.rb''']

<<<OUTPUT STARTS>>>
{"metadata":{"rubocop_version":"0.48.1","ruby_engine":"ruby","ruby_version":"2.4.1","ruby_patchlevel":"111","ruby_platform":"x86_64-darwin16"},"files":[{"path":"app/graphql/wellzestahealth_server_schema.rb","offenses":[]}],"summary":{"offense_count":0,"target_file_count":1,"inspected_file_count":1}}
<<<OUTPUT ENDS>>>

(finished - exit code 0) ['bash', '-c', 'ruby -w -c -T1 ''/tmp/nvimHLztus/14/wellzestahealth_server_schema.rb''']

<<<NO OUTPUT RETURNED>>>
@w0rp
Copy link
Member

w0rp commented Jul 26, 2017

Could you share the full error message you saw?

This is the first time I've head of asdf. I'll have to look into that.

@w0rp
Copy link
Member

w0rp commented Jul 26, 2017

It seems like every command but one is returning No such command in 2.4.1 of ruby. What's that about?

@w0rp
Copy link
Member

w0rp commented Jul 26, 2017

I just fixed the error with the brakeman linter. Now when that message is returned as the output, it will just ignore it.

@lunks
Copy link
Author

lunks commented Jul 26, 2017

This is what asdf outputs when this given binary is installed on some version, but not the current one I'm in. It'll show this up for all binaries on any language it supports, so having a way to ignore this as a global option instead of it being linter-specific would be best.

@w0rp
Copy link
Member

w0rp commented Jul 26, 2017

Does it add some stub files to PATH which output this? Is there some way to never run those stubs?

@lunks
Copy link
Author

lunks commented Jul 26, 2017

It does, I think rbenv has a similar approach. The problem with never running them is that this would disable the stub for the binaries that I do want to use.

@w0rp
Copy link
Member

w0rp commented Jul 26, 2017

I'm wondering if there's a way to detect if the executables are just stubs without having to execute them to find out.

@lunks
Copy link
Author

lunks commented Jul 26, 2017

They're inside a shims folder: /Users/lunks/.asdf/shims/rubocop

Content:

#!/usr/bin/env bash
# asdf-plugin: ruby
exec /Users/lunks/.asdf/bin/private/asdf-exec ruby bin/rubocop "$@"

Misread your question. No, I don't think there is. This is how they look.

@w0rp
Copy link
Member

w0rp commented Jul 26, 2017

For now, I'm just working on getting the Ruby linters to ignore those messages when they are returned as output. That should stop the exceptions from appearing and fix the immediate issue.

@lunks
Copy link
Author

lunks commented Jul 26, 2017

That's awesome, thanks! I'll disable linters on other languages I use with asdf for now.

rsrchboy added a commit to rsrchboy/ale that referenced this issue Jul 26, 2017
* upstream/master:
  Add a fuzzy JSON decoding function for ignoring json_decode errors for linters
  dense-analysis#810 Ignore output which isn't JSON for brakeman
  Remove channel logging
  Check the active_linter_list only for running linters
  Remove a redundant check for tsserver
  dense-analysis#517 Add more code LSP support which makes the tssserver linter behave more like the LSP linters
  Fix dense-analysis#804 - Do not run scalac for sbt files
@w0rp
Copy link
Member

w0rp commented Jul 26, 2017

Now all of the Ruby linters should ignore this kind of output.

rsrchboy added a commit to rsrchboy/ale that referenced this issue Jul 27, 2017
* upstream/master:
  dense-analysis#810 - Handle output which is not JSON in many linters
@lunks
Copy link
Author

lunks commented Jul 28, 2017

It's working great now, in Ruby and Javascript. Thanks a lot!

@lunks lunks closed this as completed Jul 28, 2017
@lunks lunks reopened this Jul 28, 2017
@lunks lunks closed this as completed Jul 28, 2017
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

2 participants