Skip to content

Draft: drm_hwcomposer: Update code formatting rules

Run:
$ clang-format-11 --style=Google --dump-config > .clang-format

New format style has a lot of improvements, like better wrapping:
'''
-  auto mode = std::find_if(connector_->modes().begin(),
-                           connector_->modes().end(),
-                           [config](DrmMode const &m) {
-                             return m.id() == config;
-                           });
+  auto mode =
+      std::find_if(connector_->modes().begin(), connector_->modes().end(),
+                   [config](DrmMode const &m) { return m.id() == config; });
'''

It also allow putting single-statement blocks into a single line:
'''
-  if (modes)
-    *modes = HAL_COLOR_MODE_NATIVE;
+  if (modes) *modes = HAL_COLOR_MODE_NATIVE;
'''
or even
'''
-uint32_t DrmConnector::mm_width() const {
-  return mm_width_;
-}
+uint32_t DrmConnector::mm_width() const { return mm_width_; }
'''

Keep code unchanged, so the new formatting rules will be applied only
to the new changes.
Edited by Roman Stratiienko

Merge request reports