TheLartians / ModernCppStarter

🚀 Kick-start your C++! A template for modern C++ projects using CMake, CI, code coverage, clang-format, reproducible dependency management and much more.
https://thelartians.github.io/ModernCppStarter
The Unlicense
4.33k stars 381 forks source link

Changed 'No' to 'false' in .clang-format #141

Closed giacomo-b closed 2 years ago

giacomo-b commented 2 years ago

Having 'No' inside .clang-format gives me the following error (Ubuntu 18.04):

YAML:6:36: error: invalid boolean
    AlwaysBreakTemplateDeclarations: 'No'
                                     ^~~~
  Error reading /home/my_path/ProjectName/.clang-format: Invalid argument

'false' fixes it.

ClausKlein commented 2 years ago
AlwaysBreakTemplateDeclarations

Which version of clang-tidy are you using?

For current version clang-tidy No is correct!

see https://clang.llvm.org/docs/ClangFormatStyleOptions.html

ClausKlein commented 2 years ago

Hey thanks for the PR! I agree that 'false' is also better for consistency as we are using for the other flags as well.

@TheLartians I can not understand the agreement? AlwaysBreakTemplateDeclarations is not a Boolean value!

TheLartians commented 2 years ago

@ClausKlein good point, I should've checked the documentation before... Thanks for the note! @giacomo-b according to the docs, it turns out that No is indeed correct here, as it's not a boolean value. I was previously under the assumption that both should be equivalent. Could you try to updating clang-format to a recent version (e.g. 12.0.0) and see if the error persists?

giacomo-b commented 2 years ago

@TheLartians sorry for the delay, I've been extremely busy. You're probably right and the problem comes from the version, I am running 6.0.0 on Ubuntu 18.04. Sorry about this.

giacomo-b commented 2 years ago

Update: I recently had the chance to install clang-format-10 and everything is working as expected with 'No'.