Skip to content

Commit

Permalink
MA-21644 setup the code format configuration
Browse files Browse the repository at this point in the history
Copied the .clang-format from platform/frameworks/base
enabled google_java_format, clang-format and disable the test
description check.

Change-Id: I211633db60335d900e3b91403251a8dda7698f2f
Signed-off-by: Haoran Wang <[email protected]>
Reviewed-on: http://androidsource.nxp.com/project/22677
Reviewed-by: Xuegang Liu <[email protected]>
  • Loading branch information
TE-N-ElvenWang committed Sep 11, 2023
1 parent 0550ca6 commit 3b20024
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
BasedOnStyle: Google

AccessModifierOffset: -4
AlignOperands: false
AllowShortFunctionsOnASingleLine: Inline
AlwaysBreakBeforeMultilineStrings: false
ColumnLimit: 100
CommentPragmas: NOLINT:.*
ConstructorInitializerIndentWidth: 6
ContinuationIndentWidth: 8
IndentWidth: 4
JavaImportGroups:
- android
- androidx
- com.android
- dalvik
- libcore
- com
- junit
- net
- org
- java
- javax
PenaltyBreakBeforeFirstCallParameter: 100000
SpacesBeforeTrailingComments: 1
10 changes: 10 additions & 0 deletions PREUPLOAD.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Builtin Hooks]
clang_format = true
gofmt = true
commit_msg_test_field = false
google_java_format = true

[Builtin Hooks Options]
clang_format = --commit ${PREUPLOAD_COMMIT} --style file --extensions c,h,cc,cpp

[Hook Scripts]

0 comments on commit 3b20024

Please sign in to comment.