Skip to content

Commit

Permalink
Merge pull request #12058 from GrahamBenHarper/muelu_clangd_format
Browse files Browse the repository at this point in the history
MueLu: Add clang-format workflow and run it on MueLu
  • Loading branch information
GrahamBenHarper authored Dec 18, 2023
2 parents 829aaed + 3c7da54 commit bee89c8
Show file tree
Hide file tree
Showing 945 changed files with 140,395 additions and 144,256 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/muelu_clang_format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Check MueLu clang-format

on: [pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: DoozyX/[email protected]
with:
source: './packages/muelu'
exclude: ''
extensions: 'cpp,hpp'
clangFormatVersion: 14
inplace: true
- run: git diff HEAD > format_patch.txt
- run: if [ "$(cat format_patch.txt)" == "" ] ; then rm format_patch.txt ; fi
- uses: actions/upload-artifact@v3
if: ${{ hashFiles('format_patch.txt') != '' }}
with:
name: MueLu format patch
path: format_patch.txt
- uses: actions/github-script@v3
if: ${{ hashFiles('format_patch.txt') != '' }}
with:
script: |
core.setFailed('Please download and apply the formatting patch! It is located at the bottom of the summary tab for this workflow.')
13 changes: 13 additions & 0 deletions packages/muelu/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#Official Tool: clang-format version 14.0.0
#Kokkos options
BasedOnStyle: google
SortIncludes: false
AlignConsecutiveAssignments: true
AllowShortCaseLabelsOnASingleLine: true
AllowShortIfStatementsOnASingleLine: true
#MueLu-specific options
ColumnLimit: 0
BreakConstructorInitializersBeforeComma: true
BreakConstructorInitializers: BeforeComma
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 2
Loading

0 comments on commit bee89c8

Please sign in to comment.