On Thu, May 12, 2016 at 7:58 AM, Brad King <brad.k...@kitware.com> wrote:
> Hi Folks,
>
> As discussed previously on the developer list:
>
>  Code style auto-formatting
>  http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/14969
>  
> http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/14969/focus=15001
>  
> http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/14969/focus=16307
>  
> http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/14969/focus=16358
>
> we've decided to change the C++ coding style within CMake to use a
> more modern style that can be automatically formatted.  We chose a
> style defined by clang-format:
>
>  ---
>  # This configuration requires clang-format 3.8 or higher.
>  BasedOnStyle: Mozilla
>  AlignOperands: false
>  AlwaysBreakAfterReturnType: None
>  AlwaysBreakAfterDefinitionReturnType: None
>  ColumnLimit: 79
>  Standard: Cpp03
>  ...
>
> A simple example of the layout is:
>
>  bool foo(int a, int b)
>  {
>    if (a < b) {
>      return true;
>    } else {
>      return false;
>    }
>  }

In a next step, we can use clang-tidy to clean up the above to:

bool foo(int a, int b)
{
  return a < b;
}

:-)
-- 

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

Reply via email to