Bladeren bron

Upgrade clang-format used in actions to 16

With a recent commit to .clang-format the minimum required version has
now increased to 16. Without this clang-format will throw an error of
".clang-format:115:3: error: unknown enumerated scalar"
EZ64cool 1 jaar geleden
bovenliggende
commit
23facd5acf
2 gewijzigde bestanden met toevoegingen van 11 en 11 verwijderingen
  1. 4 4
      .github/actions/run-clang-format/action.yaml
  2. 7 7
      build-aux/.run-format.zsh

+ 4 - 4
.github/actions/run-clang-format/action.yaml

@@ -28,7 +28,7 @@ runs:
         echo ::group::Install Dependencies
         eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
         echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH
-        echo "/home/linuxbrew/.linuxbrew/opt/clang-format@13/bin" >> $GITHUB_PATH
+        echo "/home/linuxbrew/.linuxbrew/opt/clang-format@16/bin" >> $GITHUB_PATH
         brew install --quiet zsh
         echo ::endgroup::
 
@@ -51,11 +51,11 @@ runs:
         }
 
         if (( ${changes[(I)(*.c|*.h|*.cpp|*.hpp|*.m|*.mm)]} )) {
-          echo ::group::Install clang-format-13
-          brew install --quiet obsproject/tools/clang-format@13
+          echo ::group::Install clang-format-16
+          brew install --quiet obsproject/tools/clang-format@16
           echo ::endgroup::
 
-          echo ::group::Run clang-format-13
+          echo ::group::Run clang-format-16
           ./build-aux/run-clang-format --fail-${{ inputs.failCondition }} --check
           echo ::endgroup::
         }

+ 7 - 7
build-aux/.run-format.zsh

@@ -29,23 +29,23 @@ invoke_formatter() {
 
   case ${1} {
     clang)
-      if (( ${+commands[clang-format-13]} )) {
-        local formatter=clang-format-13
+      if (( ${+commands[clang-format-16]} )) {
+        local formatter=clang-format-16
       } elif (( ${+commands[clang-format]} )) {
         local formatter=clang-format
         local -a formatter_version=($(clang-format --version))
 
-        if ! is-at-least 13.0.1 ${formatter_version[-1]}; then
-          log_error "clang-format is not version 13.0.1 or above (found ${formatter_version[-1]}."
+        if ! is-at-least 16.0.5 ${formatter_version[-1]}; then
+          log_error "clang-format is not version 16.0.5 or above (found ${formatter_version[-1]}."
           exit 2
         fi
 
-        if ! is-at-least ${formatter_version[-1]} 13.0.1; then
-          log_error "clang-format is more recent than version 13.0.1 (found ${formatter_version[-1]})."
+        if ! is-at-least ${formatter_version[-1]} 16.0.5; then
+          log_error "clang-format is more recent than version 16.0.5 (found ${formatter_version[-1]})."
           exit 2
         fi
       } else {
-        log_error "No viable clang-format version found (required 13.0.1)"
+        log_error "No viable clang-format version found (required 16.0.5)"
         exit 2
       }