forked from bblanchon/ArduinoJson
CI: added a clang-format job
This commit is contained in:
@ -3,6 +3,7 @@
|
|||||||
BasedOnStyle: Google
|
BasedOnStyle: Google
|
||||||
Standard: Cpp03
|
Standard: Cpp03
|
||||||
AllowShortFunctionsOnASingleLine: Empty
|
AllowShortFunctionsOnASingleLine: Empty
|
||||||
|
IncludeBlocks: Preserve
|
||||||
|
|
||||||
# Always break after if to get accurate coverage
|
# Always break after if to get accurate coverage
|
||||||
AllowShortIfStatementsOnASingleLine: false
|
AllowShortIfStatementsOnASingleLine: false
|
||||||
|
15
.github/workflows/ci.yml
vendored
15
.github/workflows/ci.yml
vendored
@ -3,8 +3,22 @@ name: Continuous Integration
|
|||||||
on: [push, pull_request]
|
on: [push, pull_request]
|
||||||
|
|
||||||
jobs:
|
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:
|
gcc:
|
||||||
name: GCC
|
name: GCC
|
||||||
|
needs: clang-format
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
@ -51,6 +65,7 @@ jobs:
|
|||||||
|
|
||||||
clang:
|
clang:
|
||||||
name: Clang
|
name: Clang
|
||||||
|
needs: clang-format
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
2
extras/tests/catch/.clang-format
Normal file
2
extras/tests/catch/.clang-format
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
DisableFormat: true
|
||||||
|
SortIncludes: false
|
@ -54,7 +54,7 @@ template <typename TObject>
|
|||||||
template <typename TString>
|
template <typename TString>
|
||||||
inline typename enable_if<IsString<TString*>::value,
|
inline typename enable_if<IsString<TString*>::value,
|
||||||
MemberProxy<TObject, TString*> >::type
|
MemberProxy<TObject, TString*> >::type
|
||||||
ObjectShortcuts<TObject>::operator[](TString* key) const {
|
ObjectShortcuts<TObject>::operator[](TString* key) const {
|
||||||
return MemberProxy<TObject, TString*>(*impl(), key);
|
return MemberProxy<TObject, TString*>(*impl(), key);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -62,7 +62,7 @@ template <typename TObject>
|
|||||||
template <typename TString>
|
template <typename TString>
|
||||||
inline typename enable_if<IsString<TString>::value,
|
inline typename enable_if<IsString<TString>::value,
|
||||||
MemberProxy<TObject, TString> >::type
|
MemberProxy<TObject, TString> >::type
|
||||||
ObjectShortcuts<TObject>::operator[](const TString& key) const {
|
ObjectShortcuts<TObject>::operator[](const TString& key) const {
|
||||||
return MemberProxy<TObject, TString>(*impl(), key);
|
return MemberProxy<TObject, TString>(*impl(), key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user