Commit Graph

7 Commits

Author SHA1 Message Date
Marc Chevrier
a8aa89352a clang-format: fix erroneous handling of header <queue>
The rule Regex: '^<' was not applied to this header because a more specific one applies: Regex: '^(<|")Qt?[A-Z]' used for Qt headers (rules are not case-sensitive). So adding a specific rule for this header before the Qt rule is required.
2020-01-06 17:33:45 +01:00
Marc Chevrier
fc3b4caa2e Memory management: cast functions for managed pointers 2019-11-27 16:03:04 +01:00
Marc Chevrier
185fe49f29 clang-format: Normalize headers presentation
By using clang-format directives 'IncludeBlocks' and 'IncludeCategories'
headers are regrouped by categories:
1. "cmConfigure.h" which must be first
2. header matching current implementation file
3. standard language headers
4. CMake replacement ones
5. external  headers (i.e. #include directive with '<' and '>')
6. Qt headers
7. cmsys/* headers
8. cm_* headers
9. CMake headers (i.e. starting with 'cm[A-Z]')
10. all other headers

Fixes: #19674
2019-10-01 12:25:48 -04:00
Brad King
523c443d13 clang-format.bash: update to clang-format-6.0
Update `.clang-format` with configuration to make the 6.0 format as
close as possible to what 3.8 produced before.  Then revise the style:

* Indent preprocessor directives (a feature new since 3.8)
* Add a newline and indentation before inheritance `:` and `,`

Rename the Git attribute identifying the format to include the
clang-format version number: `format.clang-format-6.0`.  This will aid
external infrastructure in knowing what version of the tool to run.
2018-06-01 09:52:02 -04:00
Brad King
8cfc45f6bd clang-format: Explicitly require version 3.8 of the tool
Versions of clang-format newer than 3.8 produce different output.
Our source code guide says that version 3.8 exactly must be used.
Update the comment in our `.clang-format` config file accordingly.
Add a check to our formatting script to verify the version.
Also update its tool search to look for the explicitly-named
3.8 variant first.
2018-05-18 09:19:10 -04:00
Daniel Pfeifer
2b4c32c95f clang-format: format all code as Cpp11 2017-08-30 11:07:05 -04:00
Brad King
1e90d78f99 Configure clang-format for CMake source tree
After discussion among developers we settled on the Mozilla style
with a few tweaks:

* Do not align operator arguments.

* Do not always break after a function return type.

* Limit to 79 columns instead of 80 to fit edge cases
  better in 80-column terminals as CMake has always done.

* Format for C++98 instead of C++11 because CMake is written
  in the former language.

Co-Author: Daniel Pfeifer <daniel@pfeifer-mail.de>
2016-05-16 16:04:46 -04:00