Commit Graph

25 Commits

Author SHA1 Message Date
Kitware Robot d9fd2f5402 Revise C++ coding style using clang-format
Run the `Utilities/Scripts/clang-format.bash` script to update
all our C++ code to a new style defined by `.clang-format`.
Use `clang-format` version 3.8.

* If you reached this commit for a line in `git blame`, re-run the blame
  operation starting at the parent of this commit to see older history
  for the content.

* See the parent commit for instructions to rebase a change across this
  style transition commit.
2016-05-16 16:05:19 -04:00
Brad King e1c7747253 Format include directive blocks and ordering with clang-format
Sort include directives within each block (separated by a blank line) in
lexicographic order (except to prioritize `sys/types.h` first).  First
run `clang-format` with the config file:

    ---
    SortIncludes: false
    ...

Commit the result temporarily.  Then run `clang-format` again with:

    ---
    SortIncludes: true
    IncludeCategories:
      - Regex:    'sys/types.h'
        Priority: -1
    ...

Commit the result temporarily.  Start a new branch and cherry-pick the
second commit.  Manually resolve conflicts to preserve indentation of
re-ordered includes.  This cleans up the include ordering without
changing any other style.

Use the following command to run `clang-format`:

    $ git ls-files -z -- \
        '*.c' '*.cc' '*.cpp' '*.cxx' '*.h' '*.hh' '*.hpp' '*.hxx' |
      egrep -z -v '(Lexer|Parser|ParserHelper)\.' |
      egrep -z -v '^Source/cm_sha2' |
      egrep -z -v '^Source/(kwsys|CursesDialog/form)/' |
      egrep -z -v '^Utilities/(KW|cm).*/' |
      egrep -z -v '^Tests/Module/GenerateExportHeader' |
      egrep -z -v '^Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h' |
      xargs -0 clang-format -i

This selects source files that do not come from a third-party.

Inspired-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
2016-04-29 13:58:54 -04:00
Kitware Robot 7bbaa4283d Remove trailing whitespace from most CMake and C/C++ code
Our Git commit hooks disallow modification or addition of lines with
trailing whitespace.  Wipe out all remnants of trailing whitespace
everywhere except third-party code.

Run the following shell code:

git ls-files -z -- \
 bootstrap doxygen.config '*.readme' \
 '*.c' '*.cmake' '*.cpp' '*.cxx' \
 '*.el' '*.f' '*.f90' '*.h' '*.in' '*.in.l' '*.java' \
 '*.mm' '*.pike' '*.py' '*.txt' '*.vim' |
egrep -z -v '^(Utilities/cm|Source/(kwsys|CursesDialog/form)/)' |
egrep -z -v '^(Modules/CPack\..*\.in)' |
xargs -0 sed -i 's/ \+$//'
2012-08-13 14:18:39 -04:00
Ken Martin 27379d7b08 ENH: make properties a bit more formal with documentation and chaining 2006-12-07 09:45:32 -05:00
Bill Hoffman 60e4fef0c6 ENH: do not use c++ comments in c code 2006-07-26 09:11:04 -04:00
Ken Martin 16a15f3e5e BUG: remove command causing issues with mid build reruns of cmake on vs70 2006-07-25 14:32:55 -04:00
Ken Martin 2433bf4517 ENH: trying a slight change 2006-07-25 12:38:17 -04:00
Ken Martin 814c7e12ab BUG: remove c++comments 2006-07-25 10:46:24 -04:00
Ken Martin 284f6c6835 BUG: temp fix 2006-07-24 16:35:32 -04:00
Ken Martin 42819b7a5d ENH: add more coverage 2006-07-24 15:40:52 -04:00
Ken Martin ad748ce26e BUG: work around XCode issue 2006-07-21 14:05:32 -04:00
Ken Martin 0189ce3424 ENH: increase coverage in a couple places 2006-07-21 10:26:05 -04:00
Bill Hoffman 9891260a6d ENH: add support for watcom wmake and wcl386 2006-01-17 10:21:45 -05:00
Ken Martin 8607e8008b ENH: increase coverage in loaded commands 2005-09-20 12:50:27 -04:00
Andy Cedilnik 50a0936ffc ENH: Remove warning 2004-05-03 12:02:00 -04:00
Bill Hoffman 781a1eaaf9 ENH: fix warnings in test 2004-05-03 08:52:03 -04:00
Bill Hoffman ee9f925509 ENH: remove warnings in tests 2004-05-02 11:50:14 -04:00
Andy Cedilnik 92ac3689c9 ENH: More coverage 2003-07-22 12:21:15 -04:00
Ken Martin fd3323177d new plugin API 2002-10-08 15:55:24 -04:00
Andy Cedilnik 4ca00b8d3e Some minor fixes for mac 2002-09-23 15:56:28 -04:00
Ken Martin 903796a76a cleanup 2002-09-23 14:57:41 -04:00
Ken Martin e5a8887426 removed c++ style comments 2002-09-20 10:06:00 -04:00
Ken Martin eab24670e3 test passing CMAKE_FLAGS 2002-09-18 11:38:15 -04:00
Ken Martin 222b04f6d9 added Destructor 2002-09-17 10:38:34 -04:00
Ken Martin 885f55b3d0 load command test 2002-09-16 16:27:00 -04:00