CI: Add new workflow to check clang-format
This commit is contained in:
parent
b2b6d834ba
commit
f0e5ecdf98
@ -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
|
||||
|
||||
...
|
||||
14
.github/workflows/on_push_clang_format.yml
vendored
Normal file
14
.github/workflows/on_push_clang_format.yml
vendored
Normal 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
|
||||
Loading…
Reference in New Issue
Block a user