mardi 2 mai 2017

how to customize fallback-style in clang-format

I do not like the BreakBeforeBraces in the default llvm style, I want to use GNU style. The final behavior of clang-format should be:

1. if .clang-format exits in project directory, use the style in .clang-format
2. if no .clang-format exits, use -style={BasedOnStyle: LLVM, BreakBeforeBraces: GNU}

from http://ift.tt/2qwjcrJ. I guess

clang-format -fallback-style='{BasedOnStyle: LLVM, BreakBeforeBraces: GNU}'

should do the job, however, I get

Invalid fallback style "{BasedOnStyle: LLVM, BreakBeforeBraces: GNU}" using LLVM style

I always use the clang-format via its vim plugin clang-format.py. If there is a method to do the job, it is also welcome.

Aucun commentaire:

Enregistrer un commentaire