From 4851107d558f129d04f64e379059168aff6706f5 Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Fri, 2 Apr 2021 09:24:21 +0000 Subject: [PATCH] Enable clang-format. Should resolve vgvassilev/clad#220. --- .clang-format | 28 ++++++++++++++++++++++++++++ .github/workflows/ci.yml | 12 +++++++++++- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 .clang-format diff --git a/.clang-format b/.clang-format new file mode 100644 index 000000000..7ea824128 --- /dev/null +++ b/.clang-format @@ -0,0 +1,28 @@ + +BasedOnStyle: LLVM +IndentWidth: 2 +NamespaceIndentation: All +ColumnLimit: 80 + +Language: Cpp +Standard: Cpp11 +DerivePointerAlignment: false +PointerAlignment: Left + +AlignAfterOpenBracket: Align +PenaltyBreakBeforeFirstCallParameter: 50 +AlignOperands: true +AllowShortCaseLabelsOnASingleLine: true +IndentCaseLabels: true + +IncludeCategories: + - Regex: '^"[^/]+\"' + Priority: 10 + - Regex: '^"cling/' + Priority: 20 + - Regex: '^"clang/' + Priority: 30 + - Regex: '^"llvm/' + Priority: 40 + - Regex: '^<' + Priority: 50 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4041a5edd..ba9dabb9f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -254,11 +254,12 @@ jobs: compiler: gcc-5 clang-runtime: '11' - - name: ubu18-gcc6-runtime11-coverage + - name: ubu18-gcc6-runtime11-analyzers os: ubuntu-18.04 compiler: gcc-6 clang-runtime: '11' coverage: true + clang-format: true - name: ubu18-gcc8-runtime11 os: ubuntu-18.04 @@ -565,6 +566,15 @@ jobs: python3 -m pip show lit cat obj/CMakeCache.txt cat obj/CMakeFiles/*.log + - name: Invoke workflow clang-format on compiler-research + if: ${{ success() && (matrix.clang-format == true) }} + uses: benc-uk/workflow-dispatch@v1 + with: + workflow: SuggestFormattingChanges + repo: compiler-research/knowall + token: ${{ secrets.PERSONAL_TOKEN }} + ref: main # The SuggestFormattingChanges branch + inputs: '{ "repo": "${{ github.repository }}", "pull_id": "${{ github.event.number }}" }' - name: Setup tmate session if: ${{ failure() }} uses: mxschmitt/action-tmate@v3