On Mon, May 9, 2016 at 11:14 AM, Brad King <[email protected]> wrote:
> On 05/02/2016 10:08 AM, Brad King wrote:
>> Next I'll look at the style updates themselves.
>
> I've made some more preparatory commits:
>
> Isolate formatted streaming blocks with clang-format off/on
> https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=64b55203
>
> Move comments off of class access specifier lines
> https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=85425a3e
>
> Help clang-format wrap after braces on long initializer lists
> https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=afca3735
>
> Remove `//------...` horizontal separator comments
> https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0ac18d40
>
> These changes improve the formatting output in some local
> experiments.
>
> With the earlier changes to the #include order we no longer need
> to use any custom `IncludeCategories`.
>
> Here is the `.clang-format` file I'd like to use:
>
> ---
> # This configuration requires clang-format 3.8 or higher.
> BasedOnStyle: Mozilla
> AlignOperands: false
> AllowShortFunctionsOnASingleLine: Inline
> AlwaysBreakAfterReturnType: None
> AlwaysBreakAfterDefinitionReturnType: None
> ColumnLimit: 79
> IndentCaseLabels: false
> Standard: Cpp03
> ...
>
"AllowShortFunctionsOnASingleLine: Inline" is default in the Mozilla
preset. This line can be removed.
What is your rationale for "IndentCaseLabels: false"? I find that
indenting them increases readability when switch statements use
hanging braces. If the opening "{" is on a separate line, indenting
the labels does not improve readability that much.
What is the rationale for "ColumnLimit: 79"? To make a line fit on old
school terminals, 80 should be OK. To make a diff or an email response
fit on old school terminals, two extra spaces are reserved. That leads
to a column limit of 78. Where does 79 come from?
--
Powered by www.kitware.com
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Kitware offers various services to support the CMake community. For more
information on each offering, please visit:
CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers