dense-analysis / ale

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

Clang-tidy is outputting correctly, but I'm getting no warning symbols in file #2507

Open cjappl opened 5 years ago

cjappl commented 5 years ago

Information

VIM version

NVIM v0.3.5 Build type: Release

Operating System:

OSX Sierra 10.12.6

What went wrong

I'm trying to configure ALE to do C++ warnings/errors in the file.

I am seeing that the clang-tidy command ran as intended in ALEInfo, but I'm not seeing any lines highlighted in vim

Reproducing the bug

  1. Disable all other plugins

  2. Set up ALE with clang-tidy and cppcheck

  3. Open a cpp file

Expected

Observed

:ALEInfo

Current Filetype: cpp Available Linters: ['ccls', 'clang', 'clangcheck', 'clangd', 'clangtidy', 'clazy', 'cppcheck', 'cpplint', 'cquery', 'flawfinder', 'gcc'] Linter Aliases: 'gcc' -> ['g++'] Enabled Linters: ['clangcheck', 'clangtidy', 'cppcheck'] Suggested Fixers: 'clang-format' - Fix C/C++ and cuda files with clang-format. '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. 'uncrustify' - Fix C, C++, C#, ObjectiveC, ObjectiveC++, D, Java, Pawn, and VALA files with uncrustify. Linter Variables:

let g:ale_cpp_clangcheck_executable = 'clang-check' let g:ale_cpp_clangcheck_options = '' let g:ale_cpp_clangtidy_checks = [',-google'] let g:ale_cpp_clangtidy_executable = 'clang-tidy' let g:ale_cpp_clangtidy_options = '' let g:ale_cpp_cppcheck_executable = 'cppcheck' let g:ale_cpp_cppcheck_options = '--enable=style' Global Variables:

let g:ale_cache_executable_check_failures = v:null let g:ale_change_sign_column_color = 0 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_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 = {'cpp': ['remove_trailing_lines'], 'json': ['prettier'], 'javascript': ['prettier'], 'css': ['prettier'], 'python': ['remove_trailing_lines', 'trim_whitespace']} 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 = 'never' let g:ale_linter_aliases = {} let g:ale_linters = {'hpp': ['clangcheck', 'clangtidy', 'cppcheck'], 'h': ['clangcheck', 'clangtidy', 'cppcheck'], 'py': ['flake8'], 'cpp': ['clangcheck', 'clangtidy', 'cppcheck']} let g:ale_linters_explicit = 0 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_statusline_format = [' %d E ', ' %d W ', ''] 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) clang-check (executable check - success) clang-tidy (finished - exit code 0) ['bash', '-c', '''clang-tidy'' -checks='',-google'' ''/Users/cjappl/Documents/Code/cjappl_europa_main/europashell/AudioFifo.cpp'' -p ''/Users/cjappl/Documents/Code/cjappl_europa_main/build''']

<<>> /System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:17:10: error: 'stdarg.h' file not found [clang-diagnostic-error]

include

     ^

/Users/cjappl/Documents/Code/cjappl_europa_main/europashell/AudioFifo.h:21:9: warning: function 'AudioFifo::WriteFromBuffer' has a definition with different parameter names [readability-inconsistent-declaration-parameter-name] int WriteFromBuffer(AudioSampleBuffer& buffer); ^ ~~~ inputBuffer /Users/cjappl/Documents/Code/cjappl_europa_main/europashell/AudioFifo.cpp:20:16: note: the definition seen here int AudioFifo::WriteFromBuffer(AudioSampleBuffer& inputBuffer) ^ /Users/cjappl/Documents/Code/cjappl_europa_main/europashell/AudioFifo.h:21:9: note: differing parameters are named here: ('buffer'), in definition: ('inputBuffer') int WriteFromBuffer(AudioSampleBuffer& buffer); ^ /Users/cjappl/Documents/Code/cjappl_europa_main/europashell/AudioFifo.h:24:9: warning: function 'AudioFifo::ReadToBuffer' has a definition with different parameter names [readability-inconsistent-declaration-parameter-name] int ReadToBuffer(AudioSampleBuffer& buffer); ^ ~~~ outputBuffer /Users/cjappl/Documents/Code/cjappl_europa_main/europashell/AudioFifo.cpp:72:16: note: the definition seen here int AudioFifo::ReadToBuffer(AudioSampleBuffer& outputBuffer) ^ /Users/cjappl/Documents/Code/cjappl_europa_main/europashell/AudioFifo.h:24:9: note: differing parameters are named here: ('buffer'), in definition: ('outputBuffer') int ReadToBuffer(AudioSampleBuffer& buffer); ^ <<>>

(executable check - success) cppcheck (finished - exit code 0) ['bash', '-c', '''cppcheck'' -q --language=c++ --enable=style ''/var/folders/n0/0fkj29b90q3_nlv8jkrxprr8m01t_4/T/nvimXyO5Yj/2/AudioFifo.cpp''']

<<>>

w0rp commented 5 years ago

I can see why this doesn't work. notes are thrown away or attached to previous warnings, and there aren't any warnings in the .cpp file, the warnings are for the header file instead. We could parse specifically these kinds of errors, but I wonder if there might be a better way to handle output like this.

cjappl commented 5 years ago

Ah, I see! Thanks for checking it out, feel free to close or do with this issue as you see fit, just wanted to see if it was something bad I was doing config wise