Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MueLu: Add clang-format workflow and run it on MueLu #12058

Merged
merged 5 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
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