dense-analysis / dense-analysis/ale

Docker linter gives "executable check - failure"

Open
#3,342 3 comments 1 reaction 1 assignee Claimed by @w0rp View on GitHub
bug
Dominant language
Vim Script
Stars
14k
Forks
1.5k
Avg merge
17h 49m
Merged PRs (30d)
1

Description

## Information

**VIM version**

NVIM v0.4.4
Build type: RelWithDebInfo

Operating System: Fedora 32

## What went wrong

As per `:help ale-lint-other-machines`, I set this in my vimrc:

```
let g:ale_linters_explicit = 1
let g:ale_linters = {
\ 'javascript': ['standard']
\}

let g:ale_fixers_explicit = 1
let g:ale_fixers = {
\ 'javascript': ['standard']
\}

let g:ale_fix_on_save = 1

au BufRead,BufNewFile *.js let [b:ale_command_wrapper, b:ale_javascript_standard_executable] = ['/path/to/docker-run.sh', 'standard']
```

And when editing a file, the bottom of `:ALEInfo` shows:

```
Command History:
(executable check - failure) standard
```

The problem is: `ale#engine#IsExecutable(..., 'standard')` returns `0` because the `standard` executable does not exist on the host machine. But it's not meant to. It's in the configured Docker instance.

Here's a workaround -- an edit to the function that I'm using right now, to get me through the day:

```
diff --git a/autoload/ale/engine.vim b/autoload/ale/engine.vim
index ae0354b8..4a579242 100644
--- a/autoload/ale/engine.vim
+++ b/autoload/ale/engine.vim
@@ -56,6 +56,10 @@ function! ale#engine#IsExecutable(buffer, executable) abort
return 0
endif

+ if !empty(b:ale_command_wrapper) && g:ale_linters_explicit && g:ale_fixers_explicit
+ return 1
+ endif
+
" Check for a cached executable() check.
let l:result = get(s:executable_cache_map, a:executable, v:null)
```

Should I make a pull request for this? This shouldn't do any harm, right? (Another idea would be `if !empty(b:ale_command_wrapper) return 1`)

### :ALEInfo

```
Current Filetype: javascript
Available Linters: ['eslint', 'fecs', 'flow', 'flow-language-server', 'jscs', 'jshint', 'standard', 'tsserver', 'xo']
Enabled Linters: ['standard']
Suggested Fixers:
'eslint' - Apply eslint --fix to a file.
'fecs' - Apply fecs format to a file.
'importjs' - automatic imports for javascript
'prettier' - Apply prettier to a file.
'prettier_eslint', 'prettier-eslint' - Apply prettier-eslint to a file.
'prettier_standard', 'prettier-standard' - Apply prettier-standard to a file.
'remove_trailing_lines' - Remove all blank lines at the end of a file.
'standard' - Fix JavaScript files using standard --fix
'trim_whitespace' - Remove all trailing whitespace characters at the end of every line.
'xo' - Fix JavaScript/TypeScript files using xo --fix.
Linter Variables:

let g:ale_javascript_standard_executable = 'standard'
let b:ale_javascript_standard_executable = 'standard'
let g:ale_javascript_standard_options = ''
let g:ale_javascript_standard_use_global = 0
Global Variables:

let g:ale_cache_executable_check_failures = v:null
let g:ale_change_sign_column_color = 0
let g:ale_command_wrapper = v:null
let b:ale_command_wrapper = '/path/to/docker-run.sh'
let g:ale_completion_delay = v:null
let g:ale_completion_enabled = 0
let g:ale_completion_max_suggestions = v:null
let g:ale_echo_cursor = 1
let g:ale_echo_msg_error_str = 'Error'
let g:ale_echo_msg_format = '%code: %%s'
let g:ale_echo_msg_info_str = 'Info'
let g:ale_echo_msg_warning_str = 'Warning'
let g:ale_enabled = 1
let g:ale_fix_on_save = 1
let g:ale_fixers = {'javascript': ['standard']}
let g:ale_history_enabled = 1
let g:ale_history_log_output = 1
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_filetype_changed = 1
let g:ale_lint_on_insert_leave = 1
let g:ale_lint_on_save = 1
let g:ale_lint_on_text_changed = 'normal'
let g:ale_linter_aliases = {}
let g:ale_linters = {'javascript': ['standard']}
let g:ale_linters_explicit = 1
let g:ale_list_vertical = 0
let g:ale_list_window_size = 10
let g:ale_loclist_msg_format = '%code: %%s'
let g:ale_lsp_root = {}
let g:ale_max_buffer_history_size = 20
let g:ale_max_signs = -1
let g:ale_maximum_file_size = v:null
let g:ale_open_list = 0
let g:ale_pattern_options = v:null
let g:ale_pattern_options_enabled = v:null
let g:ale_set_balloons = 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_info = '--'
let g:ale_sign_offset = 1000000
let g:ale_sign_style_error = '>>'
let g:ale_sign_style_warning = '--'
let g:ale_sign_warning = '--'
let g:ale_sign_highlight_linenrs = 0
let g:ale_statusline_format = v:null
let g:ale_type_map = {}
let g:ale_use_global_executables = v:null
let g:ale_virtualtext_cursor = 0
let g:ale_warn_about_trailing_blank_lines = 1
let g:ale_warn_about_trailing_whitespace = 1
Command History:

(executable check - failure) standard
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.