VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Dec 19 2022 23:29:50)
MS-Windows 64-bit GUI version with OLE support
Win10 64-bit
What went wrong
I follow ALE document to set parameter:
let g:ale_c_clangformat_style_option = '{BasedOnStyle: Microsoft, ColumnLimit:80,}'
But clang-format doesn't work. The help information of clang-format is as below:
--style=<string> - Set coding style. <string> can be:
1. A preset: LLVM, GNU, Google, Chromium, Microsoft,
Mozilla, WebKit.
2. 'file' to load style configuration from a
.clang-format file in one of the parent directories
of the source file (for stdin, see --assume-filename).
If no .clang-format file is found, falls back to
--fallback-style.
--style=file is the default.
3. 'file:<format_file_path>' to explicitly specify
the configuration file.
4. "{key: value, ...}" to set specific parameters, e.g.:
--style="{BasedOnStyle: llvm, IndentWidth: 8}"
Please note the item 4 is using double quotes. I tried to update line 25 of file ale\autoload\ale\fixers\clangformat.vim from:
let l:style_option = '-style=' . "'" . l:style_option . "'"
to
let l:style_option = '-style=' . '"' . l:style_option . '"'
then clang-format is working. So I guess this is a bug.
Reproducing the bug
I did this.
Then this happened.
:ALEInfo
Expand
let g:ale_c_clangformat_executable = 'clang-format'
let g:ale_c_clangformat_options = ''
let g:ale_c_clangformat_style_option = '{BasedOnStyle: Microsoft, ColumnLimit:80,}'
let g:ale_c_clangformat_use_global = 0
let g:ale_c_clangformat_use_local_file = 0
...
(finished - exit code 1) 'cmd /s/c "clang-format --assume-filename=arch_init.c -style=''{BasedOnStyle: Microsoft, ColumnLimit:80,}'' < C:\Users\e323819\AppData\Local\Temp\VBVB444.tmp\arch_init.c"'
Information
VIM version
VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Dec 19 2022 23:29:50) MS-Windows 64-bit GUI version with OLE support
Win10 64-bit
What went wrong
I follow ALE document to set parameter:
But
clang-format
doesn't work. The help information ofclang-format
is as below:Please note the item 4 is using double quotes. I tried to update line 25 of file ale\autoload\ale\fixers\clangformat.vim from:
to
then
clang-format
is working. So I guess this is a bug.Reproducing the bug
:ALEInfo
Expand
let g:ale_c_clangformat_executable = 'clang-format' let g:ale_c_clangformat_options = '' let g:ale_c_clangformat_style_option = '{BasedOnStyle: Microsoft, ColumnLimit:80,}' let g:ale_c_clangformat_use_global = 0 let g:ale_c_clangformat_use_local_file = 0 ... (finished - exit code 1) 'cmd /s/c "clang-format --assume-filename=arch_init.c -style=''{BasedOnStyle: Microsoft, ColumnLimit:80,}'' < C:\Users\e323819\AppData\Local\Temp\VBVB444.tmp\arch_init.c"'