CI: Add new workflow to check clang-format

This commit is contained in:
Luis Díaz Más 2022-03-15 18:25:38 +01:00
parent b2b6d834ba
commit f0e5ecdf98
2 changed files with 32 additions and 7 deletions

View File

@ -1,16 +1,26 @@
---
BasedOnStyle: Google
Language: Cpp
Standard: Cpp03
# Indentation for all files
ColumnLimit: 120
IndentWidth: 4
TabWidth: 4
UseTab: Never
ColumnLimit: 120
NamespaceIndentation: All
# C++ Options
Language: Cpp
Standard: c++17
BasedOnStyle: Google
IncludeBlocks: Preserve
AccessModifierOffset: -4
ContinuationIndentWidth: 4
IndentWidth: 4
# Constructor initializers better formatted in presence of preprocessor conditions (see image.cpp)
BreakConstructorInitializers: AfterColon
AllowAllConstructorInitializersOnNextLine: true
# break braces for most of the cases (except conditionals and loops)
BreakBeforeBraces: Custom
BraceWrapping:
AfterStruct: true
@ -20,11 +30,12 @@ BraceWrapping:
AfterEnum: true
AfterNamespace: true
# Do not allow SingleLine statements (to improve coverage statistics)
AllowShortFunctionsOnASingleLine: None
AllowShortBlocksOnASingleLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
IncludeBlocks: Preserve
Cpp11BracedListStyle: true
...

View File

@ -0,0 +1,14 @@
name: Clang Format Checker
on: [push]
jobs:
clang-format-checking:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: DoozyX/clang-format-lint-action@v0.13
with:
source: '.'
exclude: './xmpsdk ./contrib'
extensions: 'c,h,cpp,hpp'
clangFormatVersion: 12
style: file