tag | 1e2297d31858885ff9d7cb104ae9e07bba9c4658 | |
---|---|---|
tagger | The Android Open Source Project <initial-contribution@android.com> | Wed Feb 19 15:37:44 2020 -0800 |
object | b770c451762c8efb1dcf93fa9a14ad42bc550e30 |
Android R Preview 1 (RPP1.200123.016)
commit | b770c451762c8efb1dcf93fa9a14ad42bc550e30 | [log] [tgz] |
---|---|---|
author | Xin Li <delphij@google.com> | Wed Oct 30 11:50:22 2019 -0700 |
committer | Xin Li <delphij@google.com> | Wed Oct 30 11:50:22 2019 -0700 |
tree | da7f6725407d4ece9fd372ce4ce8406d5dade979 | |
parent | 8db5f2c6ac87e8c6ef41c826c3387851c4565f5f [diff] | |
parent | eed98a3e6b5edc56ba915ca24f462c1419f6fd7f [diff] |
DO NOT MERGE - qt-qpr1-dev-plus-aosp-without-vendor@5915889 into stage-aosp-master Bug: 142003500 Change-Id: I0e23d0577b29d8dd367443ca0b496084776a060f
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.