Skip to content

Update .clang-format

Igor Kushnir requested to merge work/update-clang-format into master

See also https://kate-editor.org/post/2021/2021-03-06-kde-code-formatting/

Here is a sample plugins/cmake/cmakefileapi.* diff with the new formatting config: new-clang-format-config-sample.diff

Not sure if the sorting of includes should be disabled. And whether the opening brace should be attached to the namespace line. And there is this different line-breaking of long lines.

In my opinion, these are the two worst issues in our current .clang-format:

  1. Indentation within namespaces - a recent clang-format regression?
  2. The new .clang-format makes the following line look much better:
-        static PersistentSymbolTableRepo repo { QStringLiteral("Persistent Declaration Table"), &mutex };
+        static PersistentSymbolTableRepo repo{QStringLiteral("Persistent Declaration Table"), &mutex};

Merge request reports