commit | a7bef820d9044564e7661b86e17653b4dea8397a | [log] [tgz] |
---|---|---|
author | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Fri Jul 10 18:37:43 2020 +0000 |
committer | Android (Google) Code Review <android-gerrit@google.com> | Fri Jul 10 18:37:43 2020 +0000 |
tree | c23cde41453e9697481fe3452b8d791da9bfba38 | |
parent | 55d6ed27a646a95db68a07cfaccffee76c546652 [diff] | |
parent | 36c21817c761cfe500a664dba899466577d856c1 [diff] |
Merge changes from topic "am-8ea55e01c00f43ab9a04f95d6999da61" into rvc-d1-dev-plus-aosp * changes: [automerger skipped] Migrate from blame to history scoped blame am: adef809ab8 -s ours am: a0e857181e -s ours [automerger skipped] Handle case where checkstyle does not return 2 lines. am: e1510db8d1 -s ours am: 66df0cc063 -s ours
Checkstyle is used by developers to validate Java code style and formatting, and can be run as part of the pre-upload hooks.
It can be invoked in two ways.
checkstyle.py -f FILE [FILE ...]
checkstyle.py
A development tool to help programmers write Java code that adheres to a coding standard.
Git-lint is a tool to run lint checks on only files changed in the latest commit.
To run checkstyle as part of the pre-upload hooks, add the following line to your PREUPLOAD.cfg
:
checkstyle_hook = ${REPO_ROOT}/prebuilts/checkstyle/checkstyle.py --sha ${PREUPLOAD_COMMIT}
Note that checkstyle does not always agree with clang-format, and so it's best to only have one enabled for Java.
In .clang-format
add the following to disable format checking and correcting for Java:
--- Language: Java DisableFormat: true SortIncludes: false ---
In some versions of clang-format, DisableFormat
doesn't stop the sorting of includes. So to fully disable clang-format from doing anything for Java files, both options are needed.