浏览代码

CI: Update clang-format from 10 to 12

Microsoft Visual Studio 2019 ships with LLVM/Clang 12 as of Visual
Studio 2019 16.11.0 (August 10, 2021). LLVM/Clang 12 is available on all
platforms. This change should make it easier to have clang-format "just
work" on dev systems and be consistent across platforms without having
to use an outdated version.
Ryan Foster 4 年之前
父节点
当前提交
2c5b1a837f
共有 2 个文件被更改,包括 4 次插入2 次删除
  1. 1 1
      .github/workflows/clang-format.yml
  2. 3 1
      formatcode.sh

+ 1 - 1
.github/workflows/clang-format.yml

@@ -13,7 +13,7 @@ jobs:
 
 
       - name: Install clang format
       - name: Install clang format
         run: |
         run: |
-          sudo apt-get install -y clang-format-10
+          sudo apt-get install -y clang-format-12
 
 
       - name: Check the Formatting
       - name: Check the Formatting
         run: |
         run: |

+ 3 - 1
formatcode.sh

@@ -19,7 +19,9 @@ if [[ $OS = "Linux" || $OS = "Darwin" ]] ; then
 fi
 fi
 
 
 # Discover clang-format
 # Discover clang-format
-if type clang-format-10 2> /dev/null ; then
+if type clang-format-12 2> /dev/null ; then
+    CLANG_FORMAT=clang-format-12
+elif type clang-format-10 2> /dev/null ; then
     CLANG_FORMAT=clang-format-10
     CLANG_FORMAT=clang-format-10
 elif type clang-format-8 2> /dev/null ; then
 elif type clang-format-8 2> /dev/null ; then
     CLANG_FORMAT=clang-format-8
     CLANG_FORMAT=clang-format-8