[PATCH] D27440: clang-format-vsix: fail when clang-format outputs to stderr

Antonio Maiorano via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 6 03:24:15 PST 2016


amaiorano added a comment.

In https://reviews.llvm.org/D27440#614337, @klimek wrote:

> Pondering this a bit - one question is whether we should make clang-format not return 0 if we pass -fallback-style=none (it already has this option) and we can't figure out a style. What do you think?


When you say "it already has this option", do you mean this is what fallback-style is set to by default in this extension? Because, in fact, by default it's set to LLVM. Personally, I think it should be set to "none" by default.

Having said that, to answer your question, personally I think "fallback-style" is really an option that only makes sense when "style=file" AND a file is not found. If a user has a .clang-format file, and it fails to parse correctly, they would likely find it surprising that it would then ignore that file and use the fallback style. I would much rather it just fail hard and not use the fallback style in this case.


https://reviews.llvm.org/D27440





More information about the cfe-commits mailing list