Browse Source

drm_hwcomposer: Update clang-format to 5.0

Updating clang-format to 5.0 to get a bit more control over our
styling. Two things that will be beneficial:

- Alphabeticalize headers
- More control around line breaking, especially preferring

val = SomeFunction(arg1,
                   arg2);

vs:

val =
    SomeFunction(arg1, arg2);

It's still not perfect, but it seems greatly improved.

Signed-off-by: Sean Paul <seanpaul@chromium.org>
Sean Paul 5 years ago
parent
commit
5c23d5d582
2 changed files with 5 additions and 2 deletions
  1. 3 0
      .clang-format
  2. 2 2
      .gitlab-ci.yml

+ 3 - 0
.clang-format

@@ -1,4 +1,7 @@
 BasedOnStyle: Google
+AllowAllParametersOfDeclarationOnNextLine: false
 AllowShortIfStatementsOnASingleLine: false
 AllowShortLoopsOnASingleLine: false
 AllowShortFunctionsOnASingleLine: None
+PenaltyBreakAssignment: 10000000
+PenaltyBreakBeforeFirstCallParameter: 1000

+ 2 - 2
.gitlab-ci.yml

@@ -2,7 +2,7 @@ image: ubuntu:16.04
 
 before_script:
   - apt-get --quiet update --yes >/dev/null
-  - apt-get --quiet install --yes clang-format-3.5 git >/dev/null
+  - apt-get --quiet install --yes clang-format-5.0 git >/dev/null
 
 stages:
   - style
@@ -11,7 +11,7 @@ clang-format:
   stage: style
   script:
     - git fetch https://gitlab.freedesktop.org/drm-hwcomposer/drm-hwcomposer.git
-    - git diff -U0 --no-color FETCH_HEAD...HEAD -- | clang-format-diff-3.5 -p 1 -style=file > format-fixup.patch
+    - git diff -U0 --no-color FETCH_HEAD...HEAD -- | clang-format-diff-5.0 -p 1 -style=file > format-fixup.patch
     - if [ -s format-fixup.patch ]; then cat format-fixup.patch && exit 1; fi
   artifacts:
     when: on_failure