dense-analysis / ale

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

Ansible lint: Error message when quitting vim before lint is finished #4303

Closed Nudin closed 1 year ago

Nudin commented 2 years ago

Information

VIM version NVIM v0.7.2
Build type: Release

Operating System: Arch Linux

What went wrong

When quitting vim while ansible-lint is still running, an error message is printed:

Fehler beim Ausführen von "function <SNR>181_NeoVimCallback[29]..<lambda>18[1]..<SNR>176_ExitCallback[28]..<SNR>175_HandleExit[24]..<lambda>8[1]..ale#semver#RunWithVersionCheck[8]..<lambda>19[1]..ale_linters#ansible#ansible_lint#Handle":
Zeile   18:
E474: Attempt to decode a blank string
E474: Failed to parse

Reproducing the bug

  1. Install ansible-lint
  2. Open a big ansible file
  3. Close vim :q before the lint is done

:ALEInfo

 Current Filetype: yaml.ansible
Available Linters: ['actionlint', 'circleci', 'yaml-language-server', 'spectral', 'swaglint', 'yamllint', 'ansible_lint']
   Linter Aliases:
'ansible_lint' -> ['ansible', 'ansible-lint']
  Enabled Linters: ['circleci', 'yaml-language-server', 'spectral', 'swaglint', 'ansible_lint']
  Ignored Linters: []
 Suggested Fixers: 
  'prettier' - Apply prettier to a file.
  'remove_trailing_lines' - Remove all blank lines at the end of a file.
  'trim_whitespace' - Remove all trailing whitespace characters at the end of every line.
  'yamlfix' - Fix yaml files with yamlfix.
 Linter Variables:

let g:ale_ansible_ansible_lint_executable = 'ansible-lint'
let g:ale_yaml_ls_config = {}
let g:ale_yaml_ls_executable = 'yaml-language-server'
let g:ale_yaml_ls_use_global = 0
let g:ale_yaml_spectral_executable = 'spectral'
let g:ale_yaml_spectral_use_global = 0
let g:ale_yaml_swaglint_executable = 'swaglint'
let g:ale_yaml_swaglint_use_global = 0
 Global Variables:

let g:ale_cache_executable_check_failures = v:null
let g:ale_change_sign_column_color = v:null
let g:ale_command_wrapper = ''
let g:ale_completion_delay = v:null
let g:ale_completion_enabled = 0
let g:ale_completion_max_suggestions = v:null
let g:ale_disable_lsp = 0
let g:ale_echo_cursor = 1
let g:ale_echo_msg_error_str = 'Error'
let g:ale_echo_msg_format = '[%linter%] %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': ['eslint', 'standard'], 'python': ['black', 'isort']}
let g:ale_history_enabled = 1
let g:ale_history_log_output = 1
let g:ale_keep_list_window_open = v:null
let g:ale_lint_delay = 500
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 = {'vimwiki': []}
let b:ale_linters = ['circleci', 'yaml-language-server', 'spectral', 'swaglint', 'ansible_lint']
let g:ale_linters_explicit = 0
let g:ale_linters_ignore = {'vimwiki': ['languagetool']}
let g:ale_list_vertical = v:null
let g:ale_list_window_size = v:null
let g:ale_loclist_msg_format = v:null
let g:ale_max_buffer_history_size = 20
let g:ale_max_signs = v:null
let g:ale_maximum_file_size = v:null
let g:ale_open_list = v:null
let g:ale_pattern_options = v:null
let g:ale_pattern_options_enabled = v:null
let g:ale_root = {}
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 = v:null
let g:ale_sign_error = v:null
let g:ale_sign_info = v:null
let g:ale_sign_offset = v:null
let g:ale_sign_style_error = v:null
let g:ale_sign_style_warning = v:null
let g:ale_sign_warning = v:null
let g:ale_sign_highlight_linenrs = v:null
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) yaml-language-server
(executable check - failure) spectral
(executable check - failure) swaglint
(executable check - success) ansible-lint
(finished - exit code 0) ['/bin/bash', '-c', '''ansible-lint'' --version']

<<<OUTPUT STARTS>>>
ansible-lint 6.5.2 using ansible 2.13.3
<<<OUTPUT ENDS>>>

(started) ['/bin/bash', '-c', '''ansible-lint'' --nocolor -f json -x yaml ''/home/michi/ansible/deploy-ara.yml''']
Nudin commented 2 years ago

Seems like the json_decode here needs exception handling, or alike.