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

C/C++ Linting Meta Issue #3276

Open w0rp opened 4 years ago

w0rp commented 4 years ago

There are always issues reported because detecting the correct flags to use for linting C and C++ files is nearly impossible to do well for all projects. The g:ale_c_parse_compile_commands option has now been enabled by default, so ALE can detect flags from the output of compile_commands.json files by default. I have updated the FAQ, and you should try using compile_commands.json files in your projects.

People also have issues now and then with parsing weird C or C++ errors, and it's hard to fix one thing without breaking another.

This issue will collect generally any issue relating to C/C++ linting, in an attemp to make C/C++ linting better as a whole, by default.

Known Issues

Ideas for Ease of Use

w0rp commented 4 years ago

I pushed a commit to disable make -n by default again, as someone on Reddit pointed out that make -n is not secure, and could execute arbitrary code.

dcousens commented 3 years ago

Although mentioned in the README - for others who may have missed it - if you're having issues try looking at

:ALEInfo

This command will show which executable's are invoked by ALE, their output, and what arguments were given. For me, this abundantly made clear where my configuration was malformed.

CoreyCole commented 2 years ago

@dcousens do you mind taking a look at my :ALEInfo error? I am on windows using mingw gcc.

Directory: C:\path\to\gstreamer-1.20.2\1.0\mingw_x86_64\include\gstreamer-1.0\gst\gst.h

My compile_commands.json is set up with include paths that should have gst/gst.h

[
  {
    "directory": "C:/path/to/workspace/",
    "file": "C:/path/to/entrypoint.cc",
    "arguments": [
      "x86_64-w64-mingw32-gcc",
      "-IC:/path/to/workspace/src",
      "-IC:/msys64/mingw64/include",
      "-O0", "-DDEBUG", "-ggdb", "-Wall", "-fno-omit-frame-pointer", "-mms-bitfields",
      "-IC:/path/to/gstreamer-1.20.2/1.0/mingw_x86_64/include/gstreamer-1.0",
     ...

I also put in my user config C:\path\to\AppData\Local\clangd\config.yaml

CompileFlags: # Tweak the parse settings
  Add:
    - "-IC:/path/to/gstreamer-1.20.2/1.0/mingw_x86_64/include/gstreamer-1.0"

Yet, no includes are not found in :ALEInfo:

(executable check - success) clang
(finished - exit code 1) 'cmd /s/c "clang -S -x c -o nul -iquote C:\path\to\dir -std=c11 -Wall - < C:\path\to\AppData\Local\Temp\nvim.0\1jy36r\16\filename.c"'
<<<OUTPUT STARTS>>>
In file included from <stdin>:38:
C:\path\to\header.h:33:10: fatal error: 'gst/gst.h' file not found
#include <gst/gst.h>
         ^~~~~~~~~~~
1 error generated.
<<<OUTPUT ENDS>>>
Here is my clangd output (`:CocCommand workspace.showOutput`) ``` I[03:07:14.286] clangd version 14.0.0 I[03:07:14.286] Features: windows I[03:07:14.286] PID: 31924 I[03:07:14.286] Working directory: C:/Users/stapl/workspace/omnicom-c I[03:07:14.286] argv[0]: C:\msys64\mingw64\bin\clangd.exe I[03:07:14.286] argv[1]: --log=verbose I[03:07:14.286] argv[2]: --compile-commands-dir=C:/Users/stapl/workspace/omnicom-c I[03:07:14.286] argv[3]: --query-driver=C:/msys66/mingw64/bin/**/*,C:/msys64/mingw64/lib/**/* V[03:07:14.290] User config file is C:/Users/stapl/AppData/Local/clangd/config.yaml I[03:07:14.290] Starting LSP over stdin/stdout ... V[03:07:14.306] config note at C:/Users/stapl/AppData/Local/clangd/config.yaml:1:0: Parsing config fragment V[03:07:14.306] config note at C:/Users/stapl/AppData/Local/clangd/config.yaml:1:0: Parsed 1 fragments from file V[03:07:14.306] Config fragment: compiling C:/Users/stapl/AppData/Local/clangd/config.yaml:1 -> 0x00000217D5A83110 (trusted=true) ... I[03:07:14.306] Loaded compilation database from C:/Users/stapl/workspace/omnicom-c/compile_commands.json V[03:07:14.306] Broadcasting compilation database from C:/Users/stapl/workspace/omnicom-c ... I[03:07:14.307] Enqueueing 1 commands for indexing V[03:07:14.307] System include extraction: driver x86_64-w64-mingw32-gcc expanded to C:/msys64/mingw64/bin/x86_64-w64-mingw32-gcc.exe V[03:07:14.307] System include extraction: not allowed driver C:/msys64/mingw64/bin/x86_64-w64-mingw32-gcc.exe ... I[03:07:14.309] ASTWorker building file c:/Users/stapl/workspace/omnicom-c/src/apps/omnicom.c version 1 with command [C:/Users/stapl/workspace/omnicom-c/] C:/msys64/mingw64/bin/x86_64-w64-mingw32-gcc.exe --target=x86_64-w64-mingw32 -IC:/Users/stapl/workspace/omnicom-c/src -IC:/msys64/mingw64/include -O0 -DDEBUG -ggdb -Wall -fno-omit-frame-pointer -mms-bitfields -IC:/Users/stapl/workspace/omnicom-c/ext/orc-0.4/include/orc-0.4 -IC:/Users/stapl/workspace/gstreamer-1.20.2/1.0/mingw_x86_64/include/gstreamer-1.0 -IC:/Users/stapl/workspace/gstreamer-1.20.2/1.0/mingw_x86_64/include -IC:/Users/stapl/workspace/gstreamer-1.20.2/1.0/mingw_x86_64/include/json-glib-1.0 -IC:/Users/stapl/workspace/gstreamer-1.20.2/1.0/mingw_x86_64/include/libsoup-2.4 -IC:/Users/stapl/workspace/gstreamer-1.20.2/1.0/mingw_x86_64/include/libxml2 -IC:/Users/stapl/workspace/gstreamer-1.20.2/1.0/mingw_x86_64/include -IC:/Users/stapl/workspace/gstreamer-1.20.2/1.0/mingw_x86_64/include/glib-2.0 -IC:/Users/stapl/workspace/gstreamer-1.20.2/1.0/mingw_x86_64/lib/glib-2.0/include -mms-bitfields -IC:/Users/stapl/workspace/omnicom-c/ext/orc-0.4/include/orc-0.4 -IC:/Users/stapl/workspace/gstreamer-1.20.2/1.0/mingw_x86_64/include/gstreamer-1.0 -IC:/Users/stapl/workspace/gstreamer-1.20.2/1.0/mingw_x86_64/include -IC:/Users/stapl/workspace/gstreamer-1.20.2/1.0/mingw_x86_64/include/json-glib-1.0 -IC:/Users/stapl/workspace/gstreamer-1.20.2/1.0/mingw_x86_64/include/libsoup-2.4 -IC:/Users/stapl/workspace/gstreamer-1.20.2/1.0/mingw_x86_64/include/libxml2 -IC:/Users/stapl/workspace/gstreamer-1.20.2/1.0/mingw_x86_64/include -IC:/Users/stapl/workspace/gstreamer-1.20.2/1.0/mingw_x86_64/include/glib-2.0 -IC:/Users/stapl/workspace/gstreamer-1.20.2/1.0/mingw_x86_64/lib/glib-2.0/include -LC:/Users/stapl/workspace/omnicom-c/ext/orc-0.4/lib -LC:/Users/stapl/workspace/gstreamer-1.20.2/1.0/mingw_x86_64/lib -lgstnet-1.0 -lgstaudio-1.0 -lgstsdp-1.0 -lgstwebrtc-1.0 -lgstbase-1.0 -lgstreamer-1.0 -ljson-glib-1.0 -lsoup-2.4 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lintl -lorc-0.4 -LC:/msys64/mingw64/lib -lkernel32 -liphlpapi -o binaries/omnicom-debug -IC:/Users/stapl/workspace/omnicom-c/src/ext/orc-0.4/include -IC:/Users/stapl/workspace/omnicom-c/src -IC:/Users/stapl/workspace/omnicom-c/src/lib -IC:/Users/stapl/workspace/omnicom-c/src/lib/windows -IC:/Users/stapl/workspace/omnicom-c/src/lib/linux -IC:/Users/stapl/workspace/omnicom-c/src/lib/omniaudiomixer -IC:/Users/stapl/workspace/omnicom-c/src/conference_client -IC:/Users/stapl/workspace/omnicom-c/src/mixing_server -IC:/Users/stapl/workspace/omnicom-c/src/apps -IC:/Users/stapl/workspace/omnicom-c/src/e2e -IC:/Users/stapl/workspace/gstreamer-1.20.2/1.0/mingw_x86_64/include/gstreamer-1.0 -IC:/Users/stapl/workspace/gstreamer-1.20.2/1.0/mingw_x86_64/include/glib-2.0 -IC:/Users/stapl/workspace/gstreamer-1.20.2/1.0/mingw_x86_64/include/libsoup-2.4 -IC:/Users/stapl/workspace/gstreamer-1.20.2/1.0/mingw_x86_64/include/json-glib-1.0 -IC:/Users/stapl/workspace/gstreamer-1.20.2/1.0/mingw_x86_64/lib/glib-2.0/include -resource-dir=C:/msys64/mingw64/lib/clang/14.0.0 -- c:/Users/stapl/workspace/omnicom-c/src/apps/omnicom.c V[03:07:14.310] Ignored diagnostic. -lgstnet-1.0: 'linker' input unused V[03:07:14.310] Ignored diagnostic. -lgstaudio-1.0: 'linker' input unused V[03:07:14.310] Ignored diagnostic. -lgstsdp-1.0: 'linker' input unused V[03:07:14.310] Ignored diagnostic. -lgstwebrtc-1.0: 'linker' input unused V[03:07:14.310] Ignored diagnostic. -lgstbase-1.0: 'linker' input unused V[03:07:14.310] Ignored diagnostic. -lgstreamer-1.0: 'linker' input unused V[03:07:14.310] Ignored diagnostic. -ljson-glib-1.0: 'linker' input unused V[03:07:14.310] Ignored diagnostic. -lsoup-2.4: 'linker' input unused V[03:07:14.310] Ignored diagnostic. -lgio-2.0: 'linker' input unused V[03:07:14.310] Ignored diagnostic. -lgobject-2.0: 'linker' input unused V[03:07:14.310] Ignored diagnostic. -lglib-2.0: 'linker' input unused V[03:07:14.310] Ignored diagnostic. -lintl: 'linker' input unused V[03:07:14.310] Ignored diagnostic. -lorc-0.4: 'linker' input unused V[03:07:14.310] Ignored diagnostic. -lkernel32: 'linker' input unused V[03:07:14.310] Ignored diagnostic. -liphlpapi: 'linker' input unused V[03:07:14.311] Ignored diagnostic. argument unused during compilation: '-LC:/Users/stapl/workspace/omnicom-c/ext/orc-0.4/lib' V[03:07:14.311] Ignored diagnostic. argument unused during compilation: '-LC:/Users/stapl/workspace/gstreamer-1.20.2/1.0/mingw_x86_64/lib' V[03:07:14.311] Ignored diagnostic. argument unused during compilation: '-LC:/msys64/mingw64/lib' V[03:07:14.311] Driver produced command: cc1 -cc1 -triple x86_64-w64-windows-gnu -fsyntax-only -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name omnicom.c -mrelocation-model pic -pic-level 2 -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -mms-bitfields -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -mllvm -treat-scalable-fixed-error-as-warning -debug-info-kind=constructor -dwarf-version=4 -debugger-tuning=gdb -fcoverage-compilation-dir=C:/Users/stapl/workspace/omnicom-c/ -resource-dir C:/msys64/mingw64/lib/clang/14.0.0 -I C:/Users/stapl/workspace/omnicom-c/src -I C:/msys64/mingw64/include -D DEBUG -I C:/Users/stapl/workspace/omnicom-c/ext/orc-0.4/include/orc-0.4 -I C:/Users/stapl/workspace/gstreamer-1.20.2/1.0/mingw_x86_64/include/gstreamer-1.0 -I C:/Users/stapl/workspace/gstreamer-1.20.2/1.0/mingw_x86_64/include -I C:/Users/stapl/workspace/gstreamer-1.20.2/1.0/mingw_x86_64/include/json-glib-1.0 -I C:/Users/stapl/workspace/gstreamer-1.20.2/1.0/mingw_x86_64/include/libsoup-2.4 -I C:/Users/stapl/workspace/gstreamer-1.20.2/1.0/mingw_x86_64/include/libxml2 -I C:/Users/stapl/workspace/gstreamer-1.20.2/1.0/mingw_x86_64/include -I C:/Users/stapl/workspace/gstreamer-1.20.2/1.0/mingw_x86_64/include/glib-2.0 -I C:/Users/stapl/workspace/gstreamer-1.20.2/1.0/mingw_x86_64/lib/glib-2.0/include -I C:/Users/stapl/workspace/omnicom-c/ext/orc-0.4/include/orc-0.4 -I C:/Users/stapl/workspace/gstreamer-1.20.2/1.0/mingw_x86_64/include/gstreamer-1.0 -I C:/Users/stapl/workspace/gstreamer-1.20.2/1.0/mingw_x86_64/include -I C:/Users/stapl/workspace/gstreamer-1.20.2/1.0/mingw_x86_64/include/json-glib-1.0 -I C:/Users/stapl/workspace/gstreamer-1.20.2/1.0/mingw_x86_64/include/libsoup-2.4 -I C:/Users/stapl/workspace/gstreamer-1.20.2/1.0/mingw_x86_64/include/libxml2 -I C:/Users/stapl/workspace/gstreamer-1.20.2/1.0/mingw_x86_64/include -I C:/Users/stapl/workspace/gstreamer-1.20.2/1.0/mingw_x86_64/include/glib-2.0 -I C:/Users/stapl/workspace/gstreamer-1.20.2/1.0/mingw_x86_64/lib/glib-2.0/include -I C:/Users/stapl/workspace/omnicom-c/src/ext/orc-0.4/include -I C:/Users/stapl/workspace/omnicom-c/src -I C:/Users/stapl/workspace/omnicom-c/src/lib -I C:/Users/stapl/workspace/omnicom-c/src/lib/windows -I C:/Users/stapl/workspace/omnicom-c/src/lib/linux -I C:/Users/stapl/workspace/omnicom-c/src/lib/omniaudiomixer -I C:/Users/stapl/workspace/omnicom-c/src/conference_client -I C:/Users/stapl/workspace/omnicom-c/src/mixing_server -I C:/Users/stapl/workspace/omnicom-c/src/apps -I C:/Users/stapl/workspace/omnicom-c/src/e2e -I C:/Users/stapl/workspace/gstreamer-1.20.2/1.0/mingw_x86_64/include/gstreamer-1.0 -I C:/Users/stapl/workspace/gstreamer-1.20.2/1.0/mingw_x86_64/include/glib-2.0 -I C:/Users/stapl/workspace/gstreamer-1.20.2/1.0/mingw_x86_64/include/libsoup-2.4 -I C:/Users/stapl/workspace/gstreamer-1.20.2/1.0/mingw_x86_64/include/json-glib-1.0 -I C:/Users/stapl/workspace/gstreamer-1.20.2/1.0/mingw_x86_64/lib/glib-2.0/include -internal-isystem C:/msys64/mingw64/lib/clang/14.0.0/include -internal-isystem C:/msys64/mingw64/x86_64-w64-mingw32/sys-root/mingw/include -internal-isystem C:/msys64/mingw64/x86_64-w64-mingw32/include -internal-isystem C:/msys64/mingw64/include -O0 -Wall -fdebug-compilation-dir=C:/Users/stapl/workspace/omnicom-c/ -ferror-limit 19 -fno-use-cxa-atexit -fgnuc-version=4.2.1 -exception-model=seh -faddrsig -x c c:/Users/stapl/workspace/omnicom-c/src/apps/omnicom.c ... V[03:07:14.883] indexed preamble AST for c:/Users/stapl/workspace/omnicom-c/src/apps/omnicom.c version 1: symbol slab: 18179 symbols, 5617795 bytes ref slab: 0 symbols, 0 refs, 128 bytes relations slab: 0 relations, 24 bytes V[03:07:15.047] Build dynamic index for header symbols with estimated memory usage of 13448923 bytes V[03:07:15.053] Built preamble of size 5559852 for file c:/Users/stapl/workspace/omnicom-c/src/apps/omnicom.c version 1 ```

FWIW my gd works on gst/gst.h. Takes me where I expect. And it looks like clangd output shows that it "build preamble".

sarcasticnature commented 1 year ago

clangtidy works just fine for me, but trying to use clangd is an absolute mess. If I do not put a ale_cpp_clangd_options entry into my config approximately one billion errors pop up (starting with "Too many errors emitted, stopping now"). On the other hand, however, if I specify any ale_cpp_clangd_options I get absolutely nothing.

In the former case, my ALEInfo shows:

:ALEInfo
 Current Filetype: cpp
Available Linters: ['cc', 'ccls', 'clangcheck', 'clangd', 'clangtidy', 'clazy', 'cppcheck', 'cpplint', 'cquery', 'cspell', 'flawfinder']
   Linter Aliases:
'cc' -> ['gcc', 'clang', 'g++', 'clang++']
  Enabled Linters: ['clangd']
  Ignored Linters: []
 Suggested Fixers:
  'astyle' - Fix C/C++ with astyle.
  'clang-format' - Fix C, C++, C#, CUDA, Java, JavaScript, JSON, ObjectiveC and Protobuf files with clang-format.
  'clangtidy' - Fix C/C++ and ObjectiveC files with clang-tidy.
  '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_clangd_executable = 'clangd'
let g:ale_cpp_clangd_options = ''
 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_disable_lsp = 0
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 = 0
let g:ale_fixers = ['clang-format']
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 = 0
let g:ale_lint_on_save = 0
let g:ale_lint_on_text_changed = 'never'
let g:ale_linter_aliases = {}
let g:ale_linters = {}
let b:ale_linters = ['clangd']
let g:ale_linters_explicit = 0
let b:ale_linters_explicit = 1
let g:ale_linters_ignore = {}
let g:ale_list_vertical = 0
let g:ale_list_window_size = 10
let g:ale_loclist_msg_format = '%code: %%s'
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_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 = 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 = 'all'
let g:ale_warn_about_trailing_blank_lines = 1
let g:ale_warn_about_trailing_whitespace = 1
  Command History:
(executable check - success) clangd
(started) ['sh', '-c', '''clangd'' -compile-commands-dir=''/root/ros/overlay_ws/build/compile_commands.json''']

In the latter case it shows:

 Current Filetype: cpp                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
Available Linters: ['cc', 'ccls', 'clangcheck', 'clangd', 'clangtidy', 'clazy', 'cppcheck', 'cpplint', 'cquery', 'cspell', 'flawfinder']
   Linter Aliases:
'cc' -> ['gcc', 'clang', 'g++', 'clang++']
  Enabled Linters: ['clangd']
  Ignored Linters: []
 Suggested Fixers:
  'astyle' - Fix C/C++ with astyle.
  'clang-format' - Fix C, C++, C#, CUDA, Java, JavaScript, JSON, ObjectiveC and Protobuf files with clang-format.
  'clangtidy' - Fix C/C++ and ObjectiveC files with clang-tidy.
  '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_clangd_executable = 'clangd'
let g:ale_cpp_clangd_options = ''
let b:ale_cpp_clangd_options = '-std=c++17'
 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 = '%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 = 0
let g:ale_fixers = ['clang-format']
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 = 200
let g:ale_lint_on_enter = 1
let g:ale_lint_on_filetype_changed = 1
let g:ale_lint_on_insert_leave = 0
let g:ale_lint_on_save = 0
let g:ale_lint_on_text_changed = 'never'
let g:ale_linter_aliases = {}
let g:ale_linters = {}
let b:ale_linters = ['clangd']
let g:ale_linters_explicit = 0
let b:ale_linters_explicit = 1
let g:ale_linters_ignore = {}
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 = '●'
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 = '-'
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 = 'all'
let g:ale_warn_about_trailing_blank_lines = 1
let g:ale_warn_about_trailing_whitespace = 1
  Command History:
(executable check - success) clangd

Note that in the former, the path to the compile_commands.json is correct (I am in a docker container, that's why it's a subdir of root). I have tried various ale_cpp_clangd_options, prefixed with both b: and g:.

Again, clang-tidy works a treat, so kudos on that. I would, however, like to figure out why clangd isn't working