CI: added a clang-format job

This commit is contained in:
Benoit Blanchon
2021-02-26 13:08:01 +01:00
parent 3aab36fec2
commit 9094179856
4 changed files with 20 additions and 2 deletions

View File

@ -3,6 +3,7 @@
BasedOnStyle: Google
Standard: Cpp03
AllowShortFunctionsOnASingleLine: Empty
IncludeBlocks: Preserve
# Always break after if to get accurate coverage
AllowShortIfStatementsOnASingleLine: false

View File

@ -3,8 +3,22 @@ name: Continuous Integration
on: [push, pull_request]
jobs:
clang-format:
name: Clang-Format
runs-on: ubuntu-20.04
steps:
- name: Install
run: sudo apt-get install -y clang-format
- name: Checkout
uses: actions/checkout@v2
- name: Format
run: find src/ extras/ -name '*.[ch]pp' | xargs clang-format -i --verbose --style=file
- name: Diff
run: git diff --exit-code
gcc:
name: GCC
needs: clang-format
runs-on: ubuntu-20.04
strategy:
fail-fast: false
@ -51,6 +65,7 @@ jobs:
clang:
name: Clang
needs: clang-format
runs-on: ubuntu-20.04
strategy:
fail-fast: false

View File

@ -0,0 +1,2 @@
DisableFormat: true
SortIncludes: false

View File

@ -54,7 +54,7 @@ template <typename TObject>
template <typename TString>
inline typename enable_if<IsString<TString*>::value,
MemberProxy<TObject, TString*> >::type
ObjectShortcuts<TObject>::operator[](TString* key) const {
ObjectShortcuts<TObject>::operator[](TString* key) const {
return MemberProxy<TObject, TString*>(*impl(), key);
}
@ -62,7 +62,7 @@ template <typename TObject>
template <typename TString>
inline typename enable_if<IsString<TString>::value,
MemberProxy<TObject, TString> >::type
ObjectShortcuts<TObject>::operator[](const TString& key) const {
ObjectShortcuts<TObject>::operator[](const TString& key) const {
return MemberProxy<TObject, TString>(*impl(), key);
}