Commit Graph

14 Commits

Author SHA1 Message Date
Christian Kandeler
1badc9f4a8 ClangFormat: Do not align parameters/arguments with the function name
The previous setting
    - wastes space, leading to problems when both the function name
      and the parameter (or, more likely, the argument expression)
      are long-ish.
    - necessitates re-formatting of the entire argument/parameter list
      on function renaming.

Change-Id: Ica82e284f9a5a8f2cf244938996039a59ce0b3aa
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-03-06 10:20:25 +00:00
David Schulz
9f69a87523 Update .clang-format
Define the to be used schema and update various values.

Change-Id: Id99859914447825d65419b1d467e7d8cee5d69ca
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
2024-01-03 06:10:55 +00:00
Marco Bubke
f6e162f8a2 ClangFormat: Use C++17 instead of C++11
Change-Id: I7119128708f4f7911e6fe683be29f60cc00dc130
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
2023-07-28 10:50:21 +00:00
Tim Jenssen
002d84cb15 Merge remote-tracking branch 'origin/11.0' into qds/dev
Conflicts: src/plugins/qmldesigner/designercore/metainfo/metainfo.cpp
  src/plugins/qmlprojectmanager/cmakegen/generatecmakelists.cpp
  tests/auto/qml/qmlprojectmanager/fileformat/fileformat.qbs
  tests/auto/qml/qmlprojectmanager/fileformat/tst_fileformat.cpp

Change-Id: I257f1908917bcc58805619b53b6866f2f73ca544
2023-06-02 19:26:05 +00:00
Marco Bubke
4e91fd627a Don't add braces around single line scopes
There is a new option which adds braces:
https://clang.llvm.org/docs/ClangFormatStyleOptions.html#insertbraces

Change-Id: I1b0da930fa9faadb215fff4ed653bc95da0a6a17
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
2023-06-01 09:03:18 +00:00
Yixue Wang
227e66b62c ClangFormat: Correct .clang-format
.clang-format contains some disallowed values for some fields. These
fields are corrected according to ClangFormatStyleOptions.

Change-Id: I32a40cdfeabee550ebf23f6c9cb3d1fafc3b764b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-02-16 09:28:50 +00:00
Marcus Tillmanns
d63b2ca51f ClangFormat: Parse clang-format file when needed
Previously the .clang-format was parsed even if there is an override
active.

Fixed .clang-format to follow style-guide more closely.

Change-Id: I39c5e5793cfe9e8a996e084e4ba169231a9bcebb
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2022-12-20 11:39:33 +00:00
Marcus Tillmanns
3000a0e96f formatting: Remove braces rule from .clang-format
The RemoveBracesLLVM option is not completely compatible with all
exceptions from our code style guide, so we have to remove it.

Change-Id: I4bf4405e4463eb0137ca5c2c0ad3d86deb8e903b
Reviewed-by: hjk <hjk@qt.io>
2022-04-26 11:42:29 +00:00
Marcus Tillmanns
3af260b782 docker-plugin: fix daemon state
Changed daemon state to actually check the docker runtime to determine
if its available or not.

Change-Id: I9e183658dfc7c34e229aec2a332cf303793284e5
Reviewed-by: hjk <hjk@qt.io>
2022-04-07 12:58:48 +00:00
Eike Ziller
8e69decd69 Revert "ClangFormat: Relax the clang format file a little bit"
That change does an experiment on the clang format file without
discussing the results before. It wasn't tested and discussed on a
larger code base, and ignores tests/manual/clang-format-for-qtc.

Individual ("pre-discussion") experiments with the clang-format file
should be done in a separate experimental version instead (e.g.
somewhere in dist/).

This reverts commit 009c2745e2.

Change-Id: I5f9fa50d2ccc63807218ae5d193a3a0718956576
Reviewed-by: hjk <hjk@qt.io>
2020-11-02 08:10:46 +00:00
Marco Bubke
009c2745e2 ClangFormat: Relax the clang format file a little bit
It will not always insert a line break after 100 sign but tries to find
middle ground. Normally it's not a problem but it will prevent some strange
looking formatting.

Change-Id: I0ba987f944d360b3d0f0d8dce29ef825696b1a92
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-06-30 09:52:59 +00:00
Ivan Donchevskii
40fcc728b2 ClangFormat: Use by default the same style as Qt Creator uses
Change-Id: Iae0f774873f66fcd4e297cfc260a8541f4373e36
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2019-03-07 14:03:45 +00:00
Ivan Donchevskii
e5c2b30e90 ClangFormat: Enable BreakStringLiterals in .clang-format
Change-Id: Icbd601c236cb5ad620d1bc7217a8629fe50a0046
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-11-27 10:20:52 +00:00
Ivan Donchevskii
ca84a51f86 Clang: Use clang-format for indentation
This is the new experimental plugin based on LibFormat.

It replaces the default indenter for CppEditorDocument
and applies clang-format after the CR or the set of 'electric'
characters.

Uses the global .clang-format kept in QtC settings or
the one for current project. Both can be configured.

For indentation some style modifications and code manipulations
are done to prevent line shrinking when it's not expected.

Manual indentation uses unmodified style from .clang-format file.

Change-Id: I6279b805e418e1804b553efa615f5c843f395a58
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-09-12 07:59:30 +00:00