Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stderr clang-format output got pasted into the source file #124

Open
kulvait opened this issue Mar 14, 2022 · 0 comments
Open

stderr clang-format output got pasted into the source file #124

kulvait opened this issue Mar 14, 2022 · 0 comments

Comments

@kulvait
Copy link

kulvait commented Mar 14, 2022

Thank you for the plugin!

I am running the plugin also on the system with incompatible .clang-format file with the version of clang-format. The behavior is that when I run
clang-format -i file.cpp
it formats the file and puts error message to the stderr, in my case

YAML:38:29: error: invalid boolean
BreakBeforeBinaryOperators: All 
                            ^~~
Error reading .clang-format: Invalid argument
Can't find usable .clang-format, using LLVM style

When I run :ClangFormat in vim, it inserts the output from stderr to the beginning of the source code causing its no longer valid C++ code. I think only stdout shall be pasted to the source otherwise it can break formatted code e.g. when someone do not notice or format on save.

System affected:
custom .clang-format file with
BreakBeforeBinaryOperators: All

clang-format -version
LLVM (http://llvm.org/):
  LLVM version 3.4.2
  Optimized build.
  Built Nov  1 2018 (15:06:24).
  Default target: x86_64-redhat-linux-gnu
  Host CPU: x86-64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant