clang-format
clang-format copied to clipboard
Is a noop. Returns (clang-format: success) in mini buffer
Steps to reproduce open any file with extension .cpp. and run clang-format-buffer.
-
expected behaviour: file changes
-
actual behaviour noop.
Yes, same for me. Worked for years, but currently it seems to be broken (just doesn't do anything)
I had the same issue, and managed to fix the problem by replacing clang-format.el from melpa with the one in the newest clang installation.
Finally, I figured it out. It only works if you have a .clang-format file:
https://emacs.stackexchange.com/a/55650/8261
Otherwise, it will use the fallback style. I changed it now to:
Clang Format Fallback Style: llvm
By default, it is none, which explains why nothing changed.
Thanks @philipp-classen , i-t works for me.
Copy from the stackexchange:
(*) To generate a .clang-format file, you can use:
clang-format -style=llvm -dump-config > .clang-format