Commit Graph

12 Commits

Author SHA1 Message Date
Daniel Pfeifer 3849164454 CTest: fix include-what-you-use violations 2016-08-25 09:34:37 -04:00
Daniel Pfeifer 50ad1e0a14 CTest: don't use else after return 2016-08-18 20:04:21 +02:00
Brad King fb1f5d50af Merge topic 'remove-needless-copies'
27ead963 Remove unnecessary local copies.
618fb23f Pass arguments that are not modified as const&.
2016-05-27 09:08:21 -04:00
Daniel Pfeifer 1b2bb93302 Remove redundant c_str() calls.
Run clang-tidy's readability-redundant-string-cstr checker.
Ignore findings in kwsys.
2016-05-26 22:52:22 +02:00
Daniel Pfeifer 618fb23fc9 Pass arguments that are not modified as const&.
Use clang-tidy's performance-unnecessary-value-param checker to find
value parameter declarations of expensive to copy types that are not
modified inside the function.  Ignore findings in kwsys.
After applying the fix-its, manually change `const T&` to `T const&`.
2016-05-26 21:58:51 +02:00
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
Brad King 180538c706 Source: Stabilize include order
Each source file has a logical first include file.  Include it in an
isolated block so that tools that sort includes do not move them.
2016-04-29 13:58:31 -04:00
Zack Galbreath fc58bdb9ad ctest_coverage: Add QUIET option 2015-02-23 10:02:00 -05:00
Joseph Snyder 0622f92d23 CTest: Remove code to fix scanbuild errors
Remove code from cmParseBlanketJSCoverage.cxx and
cmParseDelphiCoverage.cxx which caused scanbuild errors
about not reading the value that was stored.
2014-12-15 12:48:08 -05:00
Stephen Kelly 5eb4d7590e Remove some unneeded c_str calls. 2014-11-23 11:09:54 +01:00
Joseph Snyder 220e81345b CTest: Add Javascript coverage parser
Add a coverage parser for the Blanket.js library using the JSON output of
the mocha.js test runner.

Add a test for the new parser.
2014-10-29 11:27:11 -04:00