-
-
Notifications
You must be signed in to change notification settings - Fork 263
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add clang-format to lint the C++ codebase (#578)
* feat: Add clang-format to lint the C++ codebase * Lint cpp
- Loading branch information
Showing
14 changed files
with
817 additions
and
872 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Config for clang-format version 16 | ||
|
||
# Standard | ||
BasedOnStyle: llvm | ||
Standard: c++14 | ||
|
||
# Indentation | ||
IndentWidth: 2 | ||
ColumnLimit: 100 | ||
|
||
# Includes | ||
SortIncludes: true | ||
SortUsingDeclarations: true | ||
|
||
# Pointer and reference alignment | ||
PointerAlignment: Left | ||
ReferenceAlignment: Left | ||
ReflowComments: true | ||
|
||
# Line breaking options | ||
BreakBeforeBraces: Attach | ||
BreakConstructorInitializers: BeforeColon | ||
AllowShortFunctionsOnASingleLine: Empty | ||
IndentCaseLabels: true | ||
NamespaceIndentation: Inner | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,31 +7,30 @@ on: | |
paths: | ||
- '.github/workflows/validate-cpp.yml' | ||
- 'cpp/**' | ||
- 'MMKV/**' | ||
- 'android/src/main/cpp/**' | ||
- 'ios/**' | ||
pull_request: | ||
paths: | ||
- '.github/workflows/validate-cpp.yml' | ||
- 'cpp/**' | ||
- 'MMKV/**' | ||
- 'android/src/main/cpp/**' | ||
- 'ios/**' | ||
|
||
jobs: | ||
lint: | ||
name: cpplint | ||
name: Check clang-format | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
path: | ||
- 'cpp' | ||
- 'android/src/main/cpp' | ||
- 'ios' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: reviewdog/action-cpplint@master | ||
- name: Run clang-format style check | ||
uses: jidicula/[email protected] | ||
with: | ||
github_token: ${{ secrets.github_token }} | ||
reporter: github-pr-review | ||
flags: --linelength=230 | ||
targets: --recursive cpp android/src/main/cpp | ||
filter: "-legal/copyright\ | ||
,-readability/todo\ | ||
,-build/namespaces\ | ||
,-whitespace/comments\ | ||
,-runtime/references\ | ||
,-build/include_order\ | ||
" | ||
clang-format-version: '16' | ||
check-path: ${{ matrix.path }} | ||
|
Oops, something went wrong.