Use clang-tidy's readability-simplify-boolean-expr checker.
After applying the fix-its, revise all changes *very* carefully.
Be aware of false positives and invalid changes.
Use clang-tidy's performance-unnecessary-copy-initialization checker.
After applying the fix-its (which turns the copies into const&), revise
the changes and see whether the copies can be removed entirely by using
the original instead.
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&`.
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.
The clang-format tool may turn this:
public: // comment about access specifier
// unrelated comment indented with code
...
Into:
public: // comment about access specifier
// unrelated comment indented with code
...
Avoid this by moving comments off of access specifier lines.
The clang-format tool can do a good job formatting most code, but
well-organized streaming blocks are best left manually formatted.
Find blocks of the form
os <<
"...\n"
"...\n"
;
using the command
$ git ls-files -z -- Source |
egrep -v -z '^Source/kwsys/' |
xargs -0 pcregrep -M --color=always -B 1 -A 1 -n \
'<<[^\n]*\n(^ *("[^\n]*("|<<|;)$|;)\n){2,}'
Find blocks of the form
os << "...\n"
<< "...\n"
<< "...\n";
using the command
$ git ls-files -z -- Source |
egrep -v -z '^Source/kwsys/' |
xargs -0 pcregrep -M --color=always -B 1 -A 1 -n \
'<<[^\n]*\n(^ *<<[^\n]*(\\n"|<<|;)$\n){2,}'
Surround such blocks with the pair
/* clang-format off */
...
/* clang-format on */
in order to protect them from update by clang-format. Use the C-style
`/*...*/` comments instead of C++-style `//...` comments in order to
prevent them from ever being swallowed by re-formatting of surrounding
comments.
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>
c18d91ad Help: add release notes for topic 'ctest-run-submodule-sync'
7f560743 cmCTestGIT: run `git submodule sync` before updating submodules
06b310b5 cmCTestGIT: add an option to initialize submodules on update
56c1ea40 cmCTestGIT: fix git version references
Currently, CTest will not initialize any submodules within the already
checked out source tree. Add an option to do so. The use case for not
doing so is that some submodules may not be necessary for the current
test and keeping network usage down may be important.
This commit fixes a bug in the implementation of the test property
TIMEOUT_AFTER_MATCH. The new timeout value was being applied
every time a line was output by the test after the match had been
encountered. Now the new timeout value is only set once.
This commit also improves some output formatting related to this
property.
When performing some other testing, the globs for Blanket.js and Delphi
code coverage are picking up unintended files. Change the query for the
Delphi coverage to follow the naming convention, and check the second line
of the found JSON files for certain text before parsing them as coverage files.
Since commit v3.3.0-rc1~410^2~3 (ctest_test: Add QUIET option,
2015-02-17) if tests fail when QUIET is used one sees:
The following tests FAILED:
but not the subsequent line(s) indicating which tests failed.
Restore the list of failed tests.
Change the Cobertura handler to look for an environment variable
called "COBERTURADIR" which contains the directory where the
coverage.xml file is found. If that variable doesn't exist,
continue to use the default of the binary directory.
Update the test to use an appropriate value in the environment
variables.
Refactoring in commit v3.4.0-rc1~390^2~1 (cmCTestMultiProcessHandler:
Refactor RUN_SERIAL implementation, 2015-06-01) forgot to update a code
path for cleaning up after a failed RUN_SERIAL test. This causes an
infinite loop after a RUN_SERIAL test fails. Fix it and add a test.
The cmMakefile should get a fully prepared snapshot and not clobber its
definitions. It should eventually be able to process list files from any
starting-point snapshot, though that is some refactoring away still.
Add ctest command-line options:
--test-output-size-passed <n>
--test-output-size-failed <n>
to set the amount of test output to store in Test.xml as a command-line
dashboard client.
Instead of searching for source files in a couple hard-coded
locations, we now search the source and binary directory for files
matching both the name of the covered file and its package
directory structure.