Commit Graph

14 Commits

Author SHA1 Message Date
Lucie Gérard 749e19973f Make repository reuse compliant
Task-number: QTBUG-124453
Pick-to: 6.9 6.8
Change-Id: If49bd983e2c4726ba30ba5a5d12f63e1c6511f57
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2025-02-21 12:59:40 +01:00
Alexey Edelev aae1a25bf1 Add .proto files format to _clang-format
Use the Google format with 4 indents.

Change-Id: I852fabc07e16c19ac5555e4b34400a1c94a9d1d3
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2023-09-11 09:03:26 +02:00
Mårten Nordheim fba42d674e clang-format: Add space after template keyword
simple git grep-ing shows more uses of _with_ space than without

Change-Id: I0b2d94aa6312dd6856a2b886bc7ec028978dc0cf
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
2023-08-22 14:15:22 +00:00
Mårten Nordheim 9c1349047e clang-format: codify some of our conventions
1. We tend to use 2 spaces for indenting pre-processor directives,
when we do it. Unfortunately clang-format also counts header-guards
so not really recommended to use blindly on a header...

2. Add comments to namespaces, since the closing brace is simply
a brace with no further decoration.

3. Attach escaped new-lines on the left (instead of current: right).
Where 'right' will add the '\' characters on the far-right of our column
limit, 'left' will put them as far left as it can while having them
vertically aligned.

Change-Id: Ib5a836c76f7761d743e0100c83e7db609b959249
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2022-09-28 11:42:29 +02:00
Kai Köhne 6a4dab1134 Make sure clang-format doesn't reformat SPDX-License-Identifier
SPDX-License-Identifier needs to stay on one line to be machine
readable, even if this goes above the 100 chars limit.

Pick-to: 6.4
Change-Id: I2cc3d556e30e8d169224cc87a97a2042b47e43f7
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-06-14 08:33:07 +02:00
Kai Köhne fe9efd3594 Fix C++ version to C++17
Cpp11 is nowadays a deprecated alias to LS_Latest

https://clang.llvm.org/docs/ClangFormatStyleOptions.html

So we might as well hard-code it to C++ 17.

Change-Id: If832c6075f9e30c340a2ac8bb3b7fe13afc0f56e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2022-06-08 10:25:30 +00:00
Luca Di Sera fc7251edfa Update _clang_format to avoid adding a space in list-initialization
The current style specification for clang-format will add a space
between an identifier and an initializer_list in list-initialization.

For example:

```
auto foo{bar};
```

Would be modified to:

```
auto foo {bar};
```

The Qt Style Guidelines (https://wiki.qt.io/Qt_Coding_Style) do not seem
to dictate anything about this case, while dictating about a general
use of scope-delimiting braces that, arguably, does not apply here.

Following a rationale that is similar to the one in Google's C++ Style
Guide (https://google.github.io/styleguide/cppguide.html#Braced_Initializer_List_Format),
"SpaceBeforeCpp11BracedList" is now set to false to avoid the addition
of the aforementioned space.

Change-Id: Ic499994a24293a634858889352c717248b8d11e3
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2022-02-01 12:12:42 +00:00
Paul Wicking bd0943bf50 Update _clang-format definition
Add indentation for preprocessor directives if/ifdef/endif
as this is commonly used across Qt.

Change-Id: I0ce9851cc0861b8d18cb3717d695c871169db239
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-12-18 09:55:55 +01:00
Liang Qi bbce3228af Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	coin/provisioning/common/linux/emsdk.sh

Change-Id: I9ba6a1c52b70b605f0f856b6ce6912fd499792a3
2019-03-14 12:10:15 +01:00
Paul Wicking cc1203311a Update comment in clang-format file
Change-Id: I18f14a1956f508317f8a3995873a14bc1af29594
Reviewed-by: Andy Maloney <asmaloney@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-03-11 10:33:26 +00:00
Paul Wicking e403403b39 Update clang-format config
Set column width to 100 as described in the official Qt coding style
(https://wiki.qt.io/Qt_Coding_Style).

Also, break constructor initializers before the colon and after the commas.

Change-Id: I6ac5a21ce831a35a0d74e699192ba981c8a8ba3c
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2019-03-08 13:53:33 +00:00
Jędrzej Nowacki e8e76d256b Fix handling of structs by clang format
Our coding style expects classes to have opening braces on a new line.
Structs and classes are the same.

Before the patch:
 struct Foo {
    ...
 };

After the patch:
 struct Foo
 {
    ...
 };

Change-Id: Ifab8a402d03ef2fd75b939f39274887feedc7b1b
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-11-30 15:50:58 +00:00
Frederik Gladhorn 5872e22f31 _clang-format: indent initializers with four spaces, not eight
Change-Id: I9fc644554bd326a3a54163072b7b9e06253a5ff2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2018-08-30 09:09:28 +00:00
Frederik Gladhorn 9cd9258b8b Move _clang-format from qtrepotools
Change-Id: I9ccacaf6ed09bbc0ee3f55bf6f97d96976341d14
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-07-19 12:15:55 +00:00